sman-81 commented on PR #531: URL: https://github.com/apache/maven-surefire/pull/531#issuecomment-1120633345
> Utf8RecodingDeferredFileOutputStream.java should not be changed from Java NIO to Java IO, it cost me some time to do it with NIO. The member `file` was back changed from `Path` to `File`, as the original code mostly operates on `File` (`Path.toFile()` called in serveral places). > You involved two interests in one method. Write is write operation. Close is close. The original code opens the file in `write`, it writes the file in `free`. There was no clear separation of interests before. Why should my pull request have to introduce a separation? > I can show you my proposal to keep the file open between testStarting and test*** but then the method `writeTo` has to reopen it for reading. But is still does not make sense to do this because I am reworking it. Currently it is supposed that the test events are sequential. wym? The original code opens one file for stdout and one for stderr redirection for each test case (writing to stdout/err) and **keeps the file handles open until completion of the whole test set** _<--_ this is were the original code is flawed! Example: a parameterized test with 2000 test iterations that write to stdout and stderr hogs 4000 file handles (_in addition_ to the rest of surefire and system) and will fail on Linux assuming a maximum number of file descriptors (`ulimit -n`) setting of 4096. I've seen it happen, thus the bug report and pull request. The PR resolves the issue nicely. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
