Skip to content

Commit 31dbd15

Browse files
authored
[ML] addressing test failure (#40701)
* [ML] Fixing test * adjusting line lengths * marking valid seqno as final
1 parent d2b2f25 commit 31dbd15

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

x-pack/plugin/data-frame/src/test/java/org/elasticsearch/xpack/dataframe/checkpoint/DataFrameTransformsCheckpointServiceTests.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ public void testExtractIndexCheckpointsLostPrimaries() {
8282
}
8383
}
8484

85-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/40368")
8685
public void testExtractIndexCheckpointsInconsistentGlobalCheckpoints() {
8786
Map<String, long[]> expectedCheckpoints = new HashMap<>();
8887
Set<String> indices = randomUserIndices();
@@ -161,7 +160,7 @@ private static ShardStats[] createRandomShardStats(Map<String, long[]> expectedC
161160
long globalCheckpoint = randomBoolean() ? localCheckpoint : randomLongBetween(0L, 100000000L);
162161
long maxSeqNo = Math.max(localCheckpoint, globalCheckpoint);
163162

164-
SeqNoStats seqNoStats = new SeqNoStats(maxSeqNo, localCheckpoint, globalCheckpoint);
163+
final SeqNoStats validSeqNoStats = new SeqNoStats(maxSeqNo, localCheckpoint, globalCheckpoint);
165164
checkpoints.add(globalCheckpoint);
166165

167166
for (int replica = 0; replica < numShardCopies; replica++) {
@@ -194,10 +193,16 @@ private static ShardStats[] createRandomShardStats(Map<String, long[]> expectedC
194193

195194
if (inconsistentReplica == replica) {
196195
// overwrite
197-
seqNoStats = new SeqNoStats(maxSeqNo, localCheckpoint, globalCheckpoint + randomLongBetween(10L, 100L));
196+
SeqNoStats invalidSeqNoStats =
197+
new SeqNoStats(maxSeqNo, localCheckpoint, globalCheckpoint + randomLongBetween(10L, 100L));
198+
shardStats.add(
199+
new ShardStats(shardRouting,
200+
new ShardPath(false, path, path, shardId), stats, null, invalidSeqNoStats, null));
201+
} else {
202+
shardStats.add(
203+
new ShardStats(shardRouting,
204+
new ShardPath(false, path, path, shardId), stats, null, validSeqNoStats, null));
198205
}
199-
200-
shardStats.add(new ShardStats(shardRouting, new ShardPath(false, path, path, shardId), stats, null, seqNoStats, null));
201206
}
202207
}
203208

0 commit comments

Comments
 (0)