On Tue, 17 Mar 2026 16:21:21 GMT, Brian Burkhalter <[email protected]> wrote:

> Change the `listRoots` sub-test on Windows to check for non-empty 
> intersection of actual and expected root sets instead of equality of those 
> sets. This is to address what appears to be transient mounting of logical 
> drives during test execution.

test/jdk/java/io/File/EmptyPath.java line 304:

> 302:     @EnabledOnOs({OS.WINDOWS})
> 303:     public void listRootsWindows() {
> 304:         Set<String> expected = 
> Arrays.stream(f.getAbsoluteFile().listRoots())

listRoots is a static method so I assume this should be 
`Arrays.stream(File.listRoots())`.

test/jdk/java/io/File/EmptyPath.java line 311:

> 309:             .collect(Collectors.toSet());
> 310:         Set<String> intersection =
> 311:             
> actual.stream().filter(expected::contains).collect(Collectors.toSet());

`boolean intersects = expected.anyMatch(actual::contains);` might help here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30282#discussion_r2952010289
PR Review Comment: https://git.openjdk.org/jdk/pull/30282#discussion_r2952030576

Reply via email to