On Thu, 4 Jun 2026 10:07:40 GMT, Ivan Bereziuk <[email protected]> wrote:

>> Please review this test enhancement.
>> Implemented the padding-tolerant Unified Logging assertions.
>> A bunch of  Unified Logging assertions do not account for possible extra 
>> padding in the `[<tags>]` section.
>> 
>> Changed short-tag UL assertions from rigid `shouldContain(...)` to 
>> `shouldMatch(...)` with patterns like:
>> 
>> \[class,load *\] ...
>> 
>> 
>> Covered short categories including `class,load`, `nmt`, `pagesize`, `aot`, 
>> `jni`, `cds`, and `trimnative`. I left remaining `shouldContain()` hits 
>> alone where the tag set is long enough - `class,resolve`,  `verification`, 
>> `gc,heap,coops`, etc.).
>> 
>> Also updated a couple of existing rigid `shouldMatch()` UL regexes for the 
>> same padding issue.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Ivan Bereziuk has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   tolerate extra space in one [class,preview]. Trim redundant .\* in few 
> other checks.

test/hotspot/jtreg/runtime/NMT/MallocLimitTest.java line 118:

> 116:         output.shouldNotHaveExitValue(0);
> 117:         output.shouldMatch("\\[nmt *\\] MallocLimit: total limit: 1024K 
> \\(oom\\)");
> 118:         output.shouldMatch("\\[warning\\]\\[nmt *\\] MallocLimit: 
> reached global limit \\(triggering allocation size: \\d+[BKM], allocated so 
> far: \\d+[BKM], limit: 1024K\\)");

I would not touch these leading `.*` as they make the test still usable if the 
person running the test selects different log decorators. Arguably all log 
checks could benefit from this, though in practice the need has not arisen, but 
that doesn't mean we should remove them where they are present IMO.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31338#discussion_r3378685916

Reply via email to