Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-2082

Huge test sets may open too many files

    XMLWordPrintableJSON

Details

    Description

      Test sets with a very large number of tests (such as a JUnit ParameterizedTest with a large number of test inputs) cause surefire to open a file for stdout and another file for stderr as soon as a test method prints to either of these output streams.

      Surefire captures stdout and stderr in temporary files.

      These file handles are kept until the very end of the test set (TestSetRunListener.testSetCompleted) which may cause the limit of open files to be reached on a system, resulting in test errors (java.nio.file.FileSystemException, too many open files).

      This behavior may have been introduced with the performance improvements of SUREFIRE-1845.

      To reproduce, set the maximum allowed open files to a value lower than test iterations in a test class:
      ulimit -n <limit>
      where limit is the maximum number of open files for a user (Linux).

      Attachments

        Issue Links

          Activity

            People

              tibordigana Tibor Digana
              spannjp Markus Spann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: