Skip to content

Fix Nondeterministic Ordering in Tests #1166

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

Closed
wants to merge 2 commits into from

Conversation

leejwook96
Copy link

The following tests:
org.springframework.ws.wsdl.wsdl11.DefaultWsdl11DefinitionTest#testSoap11And12 org.springframework.ws.wsdl.wsdl11.DefaultWsdl11DefinitionTest#testImport org.springframework.ws.wsdl.wsdl11.DefaultWsdl11DefinitionTest#testInclude org.springframework.ws.wsdl.wsdl11.DefaultWsdl11DefinitionTest#testSingle org.springframework.ws.wsdl.wsdl11.Wsdl4jDefinitionTest#testGetSource

are flaky tests. .areIdentical() not only compares the elements in XML, but also checks its order making the tests flaky.

To fix this, instead of using .areIdentical or isIdentical, we used .areSimilar or isSimilar since the order of the generated XML can be different every time.

Build and unit tests pass:
Screen Shot 2020-11-14 at 4 53 16 PM

@pivotal-issuemaster
Copy link

@leejwook96 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@leaqui
Copy link
Contributor

leaqui commented Nov 14, 2020

hi @leejwook96, this issue with areIdentical() was attended at #122, with migration to XMLUnit 2.6.2.

#122 was included in #1104 and planed for 3.1 Milestone

@leejwook96 leejwook96 closed this Nov 17, 2020
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