Skip to content

Improve test reliability by resolving nondeterministic of HashMap - #316

Open
MyEnthusiastic wants to merge 2 commits into
apache:masterfrom
MyEnthusiastic:hannah-fix
Open

Improve test reliability by resolving nondeterministic of HashMap #316
MyEnthusiastic wants to merge 2 commits into
apache:masterfrom
MyEnthusiastic:hannah-fix

Conversation

@MyEnthusiastic

@MyEnthusiasticMyEnthusiastic commented Nov 27, 2023

Copy link
Copy Markdown

Problem

I detected the unstable For the test :

[INFO] org.apache.tez.dag.api.TestDAG#testRecreateDAG
[INFO] org.apache.tez.dag.api.TestDAGPlan#userVertexOrderingIsMaintained

(they both use verify and createDag function and will be affected by the order of the vertex map)

[INFO] org.apache.tez.dag.app.dag.impl.TestVertexImpl#testVertexInit

All these tests assume the order of the Map (but java provided one with ordered specification called LinkedHashMap). which was not true, and will trigger hidden bug when the test environment changes.

Solution

we used the order-specified one which is LinkedHashMap because the order does matter for the tests (and potential future tests especially because the serialization)

Do no worry too much about the performance because these tests was detected mainly because they will be used by iteration (and the order is un defined), the iteration have better performance for LinkedHashMap: https://stackoverflow.com/questions/12998568/hashmap-vs-linkedhashmap-performance-in-iteration-over-values

Reproduce

This error can be reproduced with the NondexTool with the following command (you can try that without modifying the pom, but feel free to use the plugin to protect your project and make it safer 😊 ), and this kind problem is widely documented in International Dataset of Flaky Tests (IDoFT)

mvn edu.illinois:nondex-maven-plugin:2.1.7-SNAPSHOT:nondex -pl ./wicket-core-tests -DnondexRuns=10 -Dtest=org.apache.wicket.markup.html.form.CollectionFormComponentTest#getSetUnmodifiableSet

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec24m 52sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
+0 🆗mvndep6m 27sMaven dependency ordering for branch
+1 💚mvninstall13m 28smaster passed
+1 💚compile1m 19smaster passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu122.04
+1 💚compile1m 10smaster passed with JDK Private Build-1.8.0_382-8u382-ga-1~22.04.1-b05
+1 💚checkstyle1m 25smaster passed
+1 💚javadoc1m 13smaster passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu122.04
+1 💚javadoc0m 57smaster passed with JDK Private Build-1.8.0_382-8u382-ga-1~22.04.1-b05
+0 🆗spotbugs1m 19sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs3m 3smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 9sMaven dependency ordering for patch
+1 💚mvninstall0m 48sthe patch passed
+1 💚compile0m 54sthe patch passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu122.04
+1 💚javac0m 54sthe patch passed
+1 💚compile0m 46sthe patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~22.04.1-b05
+1 💚javac0m 46sthe patch passed
+1 💚checkstyle0m 34sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 34sthe patch passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu122.04
+1 💚javadoc0m 35sthe patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~22.04.1-b05
+1 💚findbugs2m 15sthe patch passed
_ Other Tests _
+1 💚unit2m 13stez-api in the patch passed.
+1 💚unit4m 55stez-dag in the patch passed.
+1 💚asflicense0m 24sThe patch does not generate ASF License warnings.
69m 17s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-316/1/artifact/out/Dockerfile
GITHUB PR#316
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
unameLinux 17c0b8fccbce 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitypersonality/tez.sh
git revisionmaster / 51d6f53
Default JavaPrivate Build-1.8.0_382-8u382-ga-1~22.04.1-b05
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu122.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_382-8u382-ga-1~22.04.1-b05
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-316/1/testReport/
Max. process+thread count461 (vs. ulimit of 5500)
modulesC: tez-api tez-dag U: .
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-316/1/console
versionsgit=2.34.1 maven=3.6.3 findbugs=3.0.1
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@MyEnthusiastic@tez-yetus