Skip to content

Commit ad3017f

Browse files
Fix assertion in testSnapshotShutdownProgressTracker()
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 c04a956 commit ad3017f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,12 +540,13 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
540540
mockLog.awaitAllExpectationsMatched();
541541
resetMockLog();
542542

543+
assert 1 <= numShards && numShards <= 10;
543544
mockLog.addExpectation(
544-
new MockLog.SeenEventExpectation(
545+
new MockLog.PatternSeenEventExpectation(
545546
"SnapshotShutdownProgressTracker running number of snapshots",
546547
SnapshotShutdownProgressTracker.class.getCanonicalName(),
547548
Level.INFO,
548-
"*Number shard snapshots running [" + numShards + "].*"
549+
".+Number shard snapshots running \\[" + (numShards < 10 ? "[1-" + numShards + "]" : "([1-9]|10)") + "].+"
549550
)
550551
);
551552

0 commit comments

Comments
 (0)