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

Fix flaky test in URLNormalizerTest.java #1419

Merged
merged 1 commit into from
Oct 22, 2022

Conversation

yannizhou05
Copy link
Contributor

@yannizhou05 yannizhou05 commented Oct 21, 2022

The test below in URLNormalizerTest.java was found flaky because of the ordering of result String. The orders of elements in the String are not the same every time being called. In this case, two possible outputs of the String are applied to ensure the orders do not cause the flakiness. This code change is trying to fix the flaky tests mentioned above, because they sometimes fail (as the picture showed) and sometimes pass. The failure could be reproduced by the commands above by using the tool of NonDex. The code change is to make sure the tests will always pass in this case.

  • com.networknt.url.URLNormalizerTest.testAllAtOnce

The test failures could be reproduced by

  1. mvn install -pl http-url -am -DskipTests
  2. run tests with NonDex
    mvn -pl http-url edu.illinois:nondex-maven-plugin:1.1.2:nondex -Dtest=com.networknt.url.URLNormalizerTest#testAllAtOnce

3

@yannizhou05 yannizhou05 changed the title Update URLNormalizerTest.java Fix flaky test in URLNormalizerTest.java Oct 21, 2022
@stevehu stevehu merged commit 8662893 into networknt:master Oct 22, 2022
@stevehu
Copy link
Contributor

stevehu commented Oct 22, 2022

@yannizhou05 Thanks a lot for your help.

younggwon1 pushed a commit to younggwon1/light-4j that referenced this pull request Feb 10, 2024
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