Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test reliability by resolving nondeterministic of HashMap #316

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MyEnthusiastic
Copy link

@MyEnthusiastic MyEnthusiastic commented Nov 27, 2023

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

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 24m 52s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+0 🆗 mvndep 6m 27s Maven dependency ordering for branch
+1 💚 mvninstall 13m 28s master passed
+1 💚 compile 1m 19s master passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu122.04
+1 💚 compile 1m 10s master passed with JDK Private Build-1.8.0_382-8u382-ga-1~22.04.1-b05
+1 💚 checkstyle 1m 25s master passed
+1 💚 javadoc 1m 13s master passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu122.04
+1 💚 javadoc 0m 57s master passed with JDK Private Build-1.8.0_382-8u382-ga-1~22.04.1-b05
+0 🆗 spotbugs 1m 19s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 3m 3s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 9s Maven dependency ordering for patch
+1 💚 mvninstall 0m 48s the patch passed
+1 💚 compile 0m 54s the patch passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu122.04
+1 💚 javac 0m 54s the patch passed
+1 💚 compile 0m 46s the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~22.04.1-b05
+1 💚 javac 0m 46s the patch passed
+1 💚 checkstyle 0m 34s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 34s the patch passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu122.04
+1 💚 javadoc 0m 35s the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~22.04.1-b05
+1 💚 findbugs 2m 15s the patch passed
_ Other Tests _
+1 💚 unit 2m 13s tez-api in the patch passed.
+1 💚 unit 4m 55s tez-dag in the patch passed.
+1 💚 asflicense 0m 24s The patch does not generate ASF License warnings.
69m 17s
Subsystem Report/Notes
Docker ClientAPI=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 Tests dupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux 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 tool maven
Personality personality/tez.sh
git revision master / 51d6f53
Default Java Private 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 Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-316/1/testReport/
Max. process+thread count 461 (vs. ulimit of 5500)
modules C: tez-api tez-dag U: .
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-316/1/console
versions git=2.34.1 maven=3.6.3 findbugs=3.0.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

Sign up for free to 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