Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to fix the following 3 flaky test cases:
com.github.roroche.plantuml.BuildClassDiagramTaskTest.produceTests
com.github.roroche.plantuml.diagrams.ClassDiagramTest.produceTests
com.github.roroche.plantuml.diagrams.PrintDiagramTest.produceTests
I found and confirmed the flaky behavior using an open-source research tool NonDex, which shuffles implementations of nondeterminism operations.
Problem:
The order of the attributes of class that is obtained by ClassDiagramBuilder's build function is prone to changes and causes the flakiness
Solution:
Since we do not have access to the internal library, I have a added custom function that verifies that the strings are similar
Steps to reproduce
The following command can be used to reproduce the assertion errors and verify the fix.
Integrate NonDex:
Add the following snippet to the top of the build.gradle in $PROJ_DIR:
plugins {
id 'edu.illinois.nondex' version '2.1.1-1'
}
Append to build.gradle in $PROJ_DIR:
apply plugin: 'edu.illinois.nondex'
Execute Test with Gradle:
./gradlew --info test --tests com.github.roroche.plantuml.diagrams.PrintDiagramTest.produceTests
./gradlew --info test --tests com.github.roroche.plantuml.diagrams.ClassDiagramTest.produceTestsorg.apereo.portal.events.tincan.json.LrsDataModelSerializeTest.testLrsObjectSerialize
./gradlew --info test --tests com.github.roroche.plantuml.BuildClassDiagramTaskTest.produceTestsorg.apereo.portal.events.AnalyticsIncorporationComponentEventSerializationTest.testEventFiltering
Run NonDex:
./gradlew --info nondexTest --tests=com.github.roroche.plantuml.diagrams.PrintDiagramTest.produceTests --nondexRuns=50
./gradlew --info nondexTest --tests=com.github.roroche.plantuml.diagrams.ClassDiagramTest.produceTests --nondexRuns=50
./gradlew --info nondexTest --tests=com.github.roroche.plantuml.BuildClassDiagramTaskTest.produceTests --nondexRuns=50
Test Environment:
Java version "1.8.0_381"
macOS Venture Version 13.4.1 (22F82)
Please let me know if you have any concerns or questions.