Skip to content

Conversation

laminelam
Copy link
Contributor

Resolves #18056

[BUG] ClusterMaxMergesAtOnceIT is flaky

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Lamine Idjeraoui <[email protected]>
@github-actions github-actions bot added bug Something isn't working disabled-test Issues that are used by an AwaitsFix annotation to temporarily disable a broken test flaky-test Random test failure that succeeds on second run Indexing Indexing, Bulk Indexing and anything related to indexing labels Oct 15, 2025
update change log

Signed-off-by: Lamine Idjeraoui <[email protected]>
@github-actions
Copy link
Contributor

✅ Gradle check result for 17e5f99: SUCCESS

@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.03%. Comparing base (5468936) to head (17e5f99).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19647      +/-   ##
============================================
- Coverage     73.09%   73.03%   -0.06%     
+ Complexity    70723    70694      -29     
============================================
  Files          5725     5725              
  Lines        323796   323796              
  Branches      46886    46886              
============================================
- Hits         236673   236493     -180     
- Misses        68009    68241     +232     
+ Partials      19114    19062      -52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@laminelam
Copy link
Contributor Author

Hi @andrross
Do you have time to review this?

assertEquals(20, ((OpenSearchTieredMergePolicy) indexService.getIndexSettings().getMergePolicy(true)).getMaxMergeAtOnce());
assertEquals(20, ((OpenSearchTieredMergePolicy) secondIndexService.getIndexSettings().getMergePolicy(true)).getMaxMergeAtOnce());

int replicas = randomIntBetween(1, Math.max(1, internalCluster().numDataNodes() - 1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More for my own curiosity than anything -- how does this end up fixing the test?

By the default, the replica count would be 1, based on the implementation of indexSettings() on line 56. So I don't understand how setting the replica count to a random number between 1 and 1 (since it looks like numDataNodes = 2) changes anything.

I'm not particularly familiar with these tests, but I'm trying to understand more. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe generating a random integer here is enough to change the random result from randomFrom(dataNodes) on line 108 (before)/111 (after)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msfroh I think you're right. I confirmed that just adding a randomInt() call here and doing nothing with the result is enough to make the test pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working disabled-test Issues that are used by an AwaitsFix annotation to temporarily disable a broken test flaky-test Random test failure that succeeds on second run Indexing Indexing, Bulk Indexing and anything related to indexing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ClusterMaxMergesAtOnceIT is flaky

3 participants