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

test(flaky): Sorting headers for deterministic order #5754

Merged
merged 3 commits into from
Oct 3, 2024

Conversation

mumbler6
Copy link
Contributor

@mumbler6 mumbler6 commented Oct 3, 2024

The order of HTTP methods in the ALLOW header (OPTIONS,PUT vs PUT,OPTIONS) is not guaranteed to be consistent in getHeaderString(), so the following test case fails if the order changes:

This PR proposes to sort the headers 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 tests/e2e -am -DskipTests

mvn -pl tests/e2e edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=org.glassfish.jersey.tests.e2e.server.wadl.NoJAXBNoWadlTest#testOptionsNoWadl

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.

@mumbler6 mumbler6 changed the title Sorting headers for deterministic order test(flaky): Sorting headers for deterministic order Oct 3, 2024
@senivam senivam merged commit 683d924 into eclipse-ee4j:2.x Oct 3, 2024
6 of 7 checks passed
@senivam senivam added this to the 2.46 milestone Oct 3, 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.

3 participants