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

fixed flaky test in testDisabledModule() #5768

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

mumbler6
Copy link
Contributor

The order of the objects in response string returned by target("entity/simple").request().get(String.class) isn't guaranteed to be consistent, returning <{"value":"World","name":"Hello"}> instead of <{"name":"Hello","value":"World"}>. The test case testDisabledModule() fails if this happens.

This PR proposes to convert the response and expected strings into Lists, which are then sorted, so that the order assumptions (in this PR, alphabetical order) in the test cases are correct.

This change was confirmed by running the NonDex tool, which explores and reports errors in different behaviors of under-determined Java APIs.

To reproduce this problem, you can run the test with NonDex using these commands:

mvn install -pl media/json-jackson -am -DskipTests
mvn edu.illinois:nondex-maven-plugin:2.1.7:nondex -pl media/json-jackson -Dtest=org.glassfish.jersey.jackson.internal.DefaultJsonJacksonProviderForBothModulesTest#testDisabledModule

Here are screenshots of the output produced by NonDex before and after the fix:

image
image

Please let me know if you want to discuss these changes.

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.

1 participant