RFR: 8331142: Add test for number of loader threads in BasicDirectoryModel

Tejesh R tr at openjdk.org
Mon Apr 29 17:03:09 UTC 2024


On Mon, 29 Apr 2024 14:45:43 GMT, Tejesh R <tr at openjdk.org> wrote:

> > Is it necessary to create dummy files here in this test? Can't we just create JFileChooser without creating dummy files and proceed with loader test? Because I tested without using dummy files and getting exception without JDK-8325179 fix.
> 
> Yes, it is necessary to create the dummy files. The background threads need to run for a while; if there are no files, the threads may complete before the snapshot is created.
> 
> Windows is usually less affected because all scanning on Windows is serialized via the COM thread. Linux and macOS aren't stable enough without the files. Even with the files, in one of the runs on Linux, there were only 4 snapshots which contained the File Loader threads. That is 4 out of 20 snapshots taken. Without the files and with less files, the test could pass where it should fail.

You are right, failure is unpredictable in linux unlike in Windows.  Test looks good to me.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18957#issuecomment-2083225265


More information about the client-libs-dev mailing list