BAEL-4154 IOException Too many open files (#9511)
* BAEL-4154 IOException Too many open files * Add comment to explain GC dependency Co-authored-by: Carlos Grappa <carlos.grappa@mercadolibre.com>
This commit is contained in:
parent
714b47ac25
commit
5ad558c800
@ -16,6 +16,10 @@ import org.junit.jupiter.api.AfterEach;
|
|||||||
|
|
||||||
public class TooManyOpenFilesExceptionLiveTest {
|
public class TooManyOpenFilesExceptionLiveTest {
|
||||||
|
|
||||||
|
//This is not a regular UnitTest due to the fact that it depends on System.gc() to work properly.
|
||||||
|
//As we have to force the JVM to run out of file descriptors, any other tests that uses IO may fail.
|
||||||
|
//This may indirectly affect other tests that are part of the Jenkins Build.
|
||||||
|
|
||||||
private File tempFile;
|
private File tempFile;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
@ -25,6 +29,7 @@ public class TooManyOpenFilesExceptionLiveTest {
|
|||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
|
//Enforce a GC to clear unreferenced files and release descriptors
|
||||||
System.gc();
|
System.gc();
|
||||||
tempFile.delete();
|
tempFile.delete();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user