fix flaky test idHasMultiplePrefixesAndSuffixesSameOrder#1991
Open
ljmcr wants to merge 1 commit intospring-projects:mainfrom
Open
fix flaky test idHasMultiplePrefixesAndSuffixesSameOrder#1991ljmcr wants to merge 1 commit intospring-projects:mainfrom
ljmcr wants to merge 1 commit intospring-projects:mainfrom
Conversation
mikereiche
reviewed
Oct 17, 2024
Contributor
mikereiche
left a comment
There was a problem hiding this comment.
The flaky test idHasMultiplePrefixesAndSuffixesSameOrder
How is it flaky? It always passes with the correct result.
prefix and suffix are added in the same order, which can cause entity.id to vary across different runs
putting them in the same order is what makes entity.id always "333.abc.222"
| @IdSuffix(order = 1) public String suffix = "222"; | ||
| } | ||
| Entity entity = new Entity(); | ||
| entity.id = entity.prefix + '.' + entity.prefix1 + '.' + entity.someId + '.' + entity.suffix + '.' + entity.suffix1; |
Contributor
There was a problem hiding this comment.
The test is for the construction of converted.getId() by the converter. When entity.id is already it us used instead of constructing it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The flaky test idHasMultiplePrefixesAndSuffixesSameOrder was founded and detected using NonDex by running:
mvn -pl drools-model/drools-model-codegen edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=org.springframework.data.couchbase.core.mapping.MappingCouchbaseConverterTests#idHasMultiplePrefixesAndSuffixesSameOrderIn the test method, all
prefixandsuffixare added in the same order, which can causeentity.idto vary across different runs. I propose setting theentity.idto a fixed value to align with the test's intended behavior. Given that there is also a comment suggesting that the entire test may be disallowed, I would appreciate any feedback on how to best address this issue.