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

[Backport 2.x] Fix Flaky Tests testReplicaThreadedUpdateToShardLimitsAndRejections and testCoordinatingPrimaryThreadedUpdateToShardLimitsAndRejections #5450

Merged
merged 1 commit into from
Dec 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,13 @@ public void testCoordinatingPrimaryThreadedUpdateToShardLimitsAndRejections() th

nodeStats = shardIndexingPressure.stats();
IndexingPressurePerShardStats shardStoreStats = shardIndexingPressure.shardStats().getIndexingPressureShardStats(shardId1);
assertNull(shardStoreStats);
// If rejection count equals NUM_THREADS that means rejections happened until the last request, then we'll get shardStoreStats which
// was updated on the last request. In other cases, the shardStoreStats simply moves to the cold store and null is returned.
if (rejectionCount.get() == NUM_THREADS) {
assertEquals(10, shardStoreStats.getCurrentPrimaryAndCoordinatingLimits());
} else {
assertNull(shardStoreStats);
}
shardStats = shardIndexingPressure.coldStats();
if (randomBoolean) {
assertEquals(rejectionCount.get(), nodeStats.getCoordinatingRejections());
Expand Down Expand Up @@ -331,7 +337,13 @@ public void testReplicaThreadedUpdateToShardLimitsAndRejections() throws Excepti
assertEquals(0, nodeStats.getCurrentReplicaBytes());

IndexingPressurePerShardStats shardStoreStats = shardIndexingPressure.shardStats().getIndexingPressureShardStats(shardId1);
assertNull(shardStoreStats);
// If rejection count equals NUM_THREADS that means rejections happened until the last request, then we'll get shardStoreStats which
// was updated on the last request. In other cases, the shardStoreStats simply moves to the cold store and null is returned.
if (rejectionCount.get() == NUM_THREADS) {
assertEquals(15, shardStoreStats.getCurrentReplicaLimits());
} else {
assertNull(shardStoreStats);
}

shardStats = shardIndexingPressure.coldStats();
assertEquals(rejectionCount.get(), shardStats.getIndexingPressureShardStats(shardId1).getReplicaNodeLimitsBreachedRejections());
Expand Down