RFR: 8315415: OutputAnalyzer.shouldMatchByLine() fails in some cases

David Holmes dholmes at openjdk.org
Fri Sep 15 01:42:46 UTC 2023


On Thu, 14 Sep 2023 19:59:53 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

> OutputAnalyzer.shouldMatchByLine(from, to, pattern) 
> treat from and to parameters as patterns and not lines. So it might fail to compile them or work not as expected in some cases.
> 
> I grepped the usage of shouldMatchByLine and stdoutShouldMatchByLine and found that in most cases from/to are set to some regex patterns. So I just updated the names of variables and documentation to explicitly say that from/to are patterns.
> 
> See bugs for details. Tested with tier1 (mostly for validation scripts since no code changes.)

This seems reasonable. But it doesn't seem to fix the issue that was reported in the bug report. Was that test subsequently modified to ensure the line did not happen to contain regex pattern meta-characters?

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

PR Review: https://git.openjdk.org/jdk/pull/15753#pullrequestreview-1628075185


More information about the hotspot-dev mailing list