Skip to content

Commit d07ec0c

Browse files
Fix assertion in SnapshotShutdownIT.testSnapshotShutdownProgressTracker() (#127998)
Relaxes a log expectation assertion from an exact test of numShards running snapshots to 1-numShards, since it is possible for some of the shard snapshot statuses to already be in stage=PAUSED. Closes #127690
1 parent d4b387c commit d07ec0c

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

muted-tests.yml

-3
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,6 @@ tests:
417417
- class: org.elasticsearch.action.admin.indices.diskusage.IndexDiskUsageAnalyzerTests
418418
method: testKnnVectors
419419
issue: https://github.com/elastic/elasticsearch/issues/127689
420-
- class: org.elasticsearch.snapshots.SnapshotShutdownIT
421-
method: testSnapshotShutdownProgressTracker
422-
issue: https://github.com/elastic/elasticsearch/issues/127690
423420
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
424421
method: test {p0=search/350_point_in_time/point-in-time with index filter}
425422
issue: https://github.com/elastic/elasticsearch/issues/127741

server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotShutdownIT.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ public void testShutdownWhileSuccessInFlight() throws Exception {
480480
)
481481
public void testSnapshotShutdownProgressTracker() throws Exception {
482482
final var repoName = randomIdentifier();
483-
final int numShards = randomIntBetween(1, 10);
483+
final int numShards = randomIntBetween(1, 9);
484484
createRepository(repoName, "mock");
485485

486486
// Create another index on another node which will be blocked (remain in state INIT) throughout.
@@ -540,12 +540,14 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
540540
mockLog.awaitAllExpectationsMatched();
541541
resetMockLog();
542542

543+
// At least one shard reached the MockRepository's blocking code when waitForBlock was called. However, there's no guarantee that
544+
// the other shards got that far before the shutdown flag was put in place, in which case the other shards may be paused instead.
543545
mockLog.addExpectation(
544-
new MockLog.SeenEventExpectation(
546+
new MockLog.PatternSeenEventExpectation(
545547
"SnapshotShutdownProgressTracker running number of snapshots",
546548
SnapshotShutdownProgressTracker.class.getCanonicalName(),
547549
Level.INFO,
548-
"*Number shard snapshots running [" + numShards + "].*"
550+
".+Number shard snapshots running \\[[1-" + numShards + "]].+"
549551
)
550552
);
551553

0 commit comments

Comments
 (0)