-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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 AllocateRoutedStepTests reusing keys for random values #51016
Fix AllocateRoutedStepTests reusing keys for random values #51016
Conversation
In these tests there was a very small chance that keys could collide, which causes test failures. Resolves elastic#49307
Pinging @elastic/es-core-features (:Core/Features/ILM+SLM) |
@@ -114,7 +114,7 @@ public void testInvalidNumberOfReplicas() { | |||
Map<String, String> map = new HashMap<>(); | |||
int numIncludes = randomIntBetween(minEntries, maxEntries); | |||
for (int i = 0; i < numIncludes; i++) { | |||
map.put(randomAlphaOfLengthBetween(1, 20), randomAlphaOfLengthBetween(1, 20)); | |||
map.put(randomAlphaOfLengthBetween(2, 20), randomAlphaOfLengthBetween(2, 20)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the reason behind this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the test that actually caused the failure generated n
as the key in the map, by increasing it to at least 2, we decrease the chance of collisions. The other changes make sure we don't have collisions, but this at least decreases the amount of retries since it's less likely to collide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for showing tests some ❤ @dakrone
@elasticmachine update branch |
user doesn't have permission to update head repository |
…1016) In these tests there was a very small chance that keys could collide, which causes test failures. Resolves elastic#49307
…1016) In these tests there was a very small chance that keys could collide, which causes test failures. Resolves elastic#49307
In these tests there was a very small chance that keys could collide, which causes test failures. Backport of elastic#51016
In these tests there was a very small chance that keys could collide, which causes test failures. Backport of #51016 Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com>
In these tests there was a very small chance that keys could collide,
which causes test failures.
Resolves #49307