RFR: 8369232: testlibrary_tests/ir_framework/tests/TestScenariosCrossProduct.java timed out [v2]

Christian Hagedorn chagedorn at openjdk.org
Tue Oct 14 08:58:46 UTC 2025


On Mon, 13 Oct 2025 14:17:20 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Christian Hagedorn has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Merge branch 'master' into JDK-8369232
>>  - add missing test
>>  - 8369236: testlibrary_tests/ir_framework/tests/TestScenariosCrossProduct.java timed out
>
> test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestScenariosCrossProduct.java line 251:
> 
>> 249:                         continue outer;
>> 250:                     }
>> 251:                 }
> 
> You could probably do this with an `stream().anyMatch()`:
> Suggestion:
> 
>                 if (scenarios.stream().anyMatch(s -> s.equals(expectedScenarioFlags))) {
>                     continue;
>                 }
> 
> You may even be able to further simplify the lambda in there, to get rid of the `s`.

Thanks for the suggestion. `s` in your code is a `Scenario` while `expectedScenarioFlags` is a `Set<String>`. But maybe you meant, to first `map()` the scenarios to `getFlags()` and then do the comparison. That would work but `getFlags()` returns a `List`. We first need to convert it to a `Set` in order to call `equals()` which ignores the order. It could look like this:

if (scenariosFromCrossProduct.stream()
        .map(Scenario::getFlags)
        .map(HashSet::new)
        .anyMatch(flags -> flags.equals(expectedScenarioFlags))) {
    continue;
}
 ```
I'm fine with both.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27672#discussion_r2428416151


More information about the hotspot-compiler-dev mailing list