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

[BUG] Flaky test SegmentReplicationAllocationIT.testPerIndexPrimaryAllocation #7751

Closed
raghuvanshraj opened this issue May 25, 2023 · 1 comment · Fixed by #8366 or #8372
Closed

[BUG] Flaky test SegmentReplicationAllocationIT.testPerIndexPrimaryAllocation #7751

raghuvanshraj opened this issue May 25, 2023 · 1 comment · Fixed by #8366 or #8372
Assignees
Labels
bug Something isn't working distributed framework flaky-test Random test failure that succeeds on second run

Comments

@raghuvanshraj
Copy link
Contributor

Describe the bug

java.lang.AssertionError
	at __randomizedtesting.SeedInfo.seed([9631830FBDB9647:8D5956FBA87A66E1]:0)
	at org.junit.Assert.fail(Assert.java:87)
	at org.junit.Assert.assertTrue(Assert.java:42)
	at org.junit.Assert.assertTrue(Assert.java:53)
	at org.opensearch.indices.replication.SegmentReplicationAllocationIT.lambda$verifyPerIndexPrimaryBalance$0(SegmentReplicationAllocationIT.java:252)

To Reproduce

Expected behavior
Test should always pass

@nknize
Copy link
Collaborator

nknize commented Jun 23, 2023

Offending assertion is here

assertTrue(primaryCount <= avgPrimaryShardsPerNode);

Where: final int avgPrimaryShardsPerNode = (int) Math.ceil(totalPrimaryShards * 1f / currentState.getRoutingNodes().size());

Does it make sense comparing to an average? Averages are subject to a variance so the actual could occasionally be higher. Seems periodic failures should be expected if an occasional test run produces even one more than the average?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working distributed framework flaky-test Random test failure that succeeds on second run
Projects
Status: Done
5 participants