RFR: 8273361: InfoOptsTest is failing in tier1

Aleksey Shipilev shade at openjdk.java.net
Mon Sep 6 14:13:45 UTC 2021

Current test checks that informational messages are not printed twice. The failing tests verifies that by checking `java.specification.version` is not present twice in the version string. Effectively, it searches for `18`. But a second `18` could get to version string from anywhere: the Git hash, the user name, etc. It is failing in current GHA due to Git hash containing `18`.

I believe the test should be more conservative: look for more unique strings, and check that the lines start with it. "javac" and "javac full version" seem unique enough. Checking that lines start with "javac" handles the case of accidental version strings that includes that string (think username that includes "javac" for some reason, who are we to judge...).

Additional testing:
 - [x] Affected test passes with default version string
 - [x] Affected test fails with JDK-8266239 reverted
 - [ ] Affected test passes with `--with-version-opt=javac`


Commit messages:
 - Check that lines start with the message to avoid collisions completely
 - Do not look for specification version in the version string

Changes: https://git.openjdk.java.net/jdk/pull/5381/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5381&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8273361
  Stats: 20 lines in 2 files changed: 8 ins; 1 del; 11 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5381.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5381/head:pull/5381

PR: https://git.openjdk.java.net/jdk/pull/5381

More information about the compiler-dev mailing list