RFR: 8340116: test/jdk/sun/security/tools/jarsigner/PreserveRawManifestEntryAndDigest.java can fail due to regex
duke
duke at openjdk.org
Thu Oct 31 18:47:28 UTC 2024
On Tue, 1 Oct 2024 08:51:29 GMT, Fernando Guallini <fguallini at openjdk.org> wrote:
> The test **sun/security/tools/jarsigner/PreserveRawManifestEntryAndDigest.java** may fail with the following exception:
>
>
> test PreserveRawManifestEntryAndDigest.testNameImmediatelyContinued(): failure
> java.lang.AssertionError: "s k 300 Tue Jun 25 10:20:16 GMT+07:00 2024 META-INF/MANIFEST.MF" should have matched "s k *\\d+ .{28,29} META-INF/MANIFEST[.]MF" expected [true] but found [false]
>
>
> The failure occurs due to a mismatch in the expected timestamp format, this happens because jarsigner uses the system's current timezone for output timestamps when signing. The current regular expression expects a timestamp length of 28 or 29 characters, which works if the test is run from a timezone like PST or CEST. However, it fails for longer timezone formats, such as 'GMT+07:00'.
>
> This PR updates the regular expression ensuring that the test can handle a wider range of timezone strings. Also, removed a couple of unused params from a method.
@fguallini
Your change (at version 5a42937a94a66449ee57635c72701d23c618c8ae) is now ready to be sponsored by a Committer.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/21280#issuecomment-2450591802
More information about the security-dev
mailing list