I was unable to recreate the error but it looks like the problem could happen if two instances of the test are run on the same machine. Also, if the deleteEntry() calls in the finally block throw an exception, they can hide any exceptions thrown earlier in the test.
I updated the test to use randomly generated alias names. I also updated the finally block so exceptions thrown by deleteEntry() are logged but not thrown. ------------- Commit messages: - 8321925: sun/security/mscapi/KeytoolChangeAlias.java fails with "Alias <246810> does not exist" Changes: https://git.openjdk.org/jdk/pull/17352/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17352&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8321925 Stats: 22 lines in 1 file changed: 13 ins; 0 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/17352.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17352/head:pull/17352 PR: https://git.openjdk.org/jdk/pull/17352