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:
Carlos Grappa 2020-06-19 00:04:32 -03:00 committed by GitHub
parent 714b47ac25
commit 5ad558c800
1 changed files with 5 additions and 0 deletions

View File

@ -16,6 +16,10 @@ import org.junit.jupiter.api.AfterEach;
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;
@BeforeEach
@ -25,6 +29,7 @@ public class TooManyOpenFilesExceptionLiveTest {
@AfterEach
public void tearDown() {
//Enforce a GC to clear unreferenced files and release descriptors
System.gc();
tempFile.delete();
}