jackrabbit-oak icon indicating copy to clipboard operation
jackrabbit-oak copied to clipboard

Fix indeterminate map ordering that may causes Sweep2Test to fail

Open MarcyGO opened this issue 2 years ago • 1 comments

The test org.apache.jackrabbit.oak.plugins.document.Sweep2Test#testSweep2Uncommitted can fail based on the order of iteration in HashMap. I found the issue using NonDex:

mvn install -DskipTests -pl oak-store-document -am
mvn -pl oak-store-document edu.illinois:nondex-maven-plugin:1.1.2:nondex -Dtest=org.apache.jackrabbit.oak.plugins.document.Sweep2Test#testSweep2Uncommitted

The proposed fix changes several HashMap to LinkedHashMap, which has determinate iteration order.

MarcyGO avatar Apr 30 '22 17:04 MarcyGO

@MarcyGO please create a JIRA issue for this PR.

Preferably the PR should also have a unit test that reproduces the issue reliably.

I'm not sure the fix is done at the appropriate place. The proposed changes are in module oak-store-spi. Does the current implementation of those two classes really require a determinate iteration order or is it rather Sweep2Test that makes assumptions about an implementation detail? Maybe just the test should be fixed.

mreutegg avatar May 03 '22 06:05 mreutegg

This PR is stale because it has been open 24 months with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar May 03 '24 01:05 github-actions[bot]