Skip to content

Commit

Permalink
[ML] addressing test failure (elastic#40701)
Browse files Browse the repository at this point in the history
* [ML] Fixing test

* adjusting line lengths

* marking valid seqno as final
  • Loading branch information
benwtrent authored and Gurkan Kaymak committed May 27, 2019
1 parent c911ecf commit 5236fc3
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public void testExtractIndexCheckpointsLostPrimaries() {
}
}

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

SeqNoStats seqNoStats = new SeqNoStats(maxSeqNo, localCheckpoint, globalCheckpoint);
final SeqNoStats validSeqNoStats = new SeqNoStats(maxSeqNo, localCheckpoint, globalCheckpoint);
checkpoints.add(globalCheckpoint);

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

if (inconsistentReplica == replica) {
// overwrite
seqNoStats = new SeqNoStats(maxSeqNo, localCheckpoint, globalCheckpoint + randomLongBetween(10L, 100L));
SeqNoStats invalidSeqNoStats =
new SeqNoStats(maxSeqNo, localCheckpoint, globalCheckpoint + randomLongBetween(10L, 100L));
shardStats.add(
new ShardStats(shardRouting,
new ShardPath(false, path, path, shardId), stats, null, invalidSeqNoStats, null));
} else {
shardStats.add(
new ShardStats(shardRouting,
new ShardPath(false, path, path, shardId), stats, null, validSeqNoStats, null));
}

shardStats.add(new ShardStats(shardRouting, new ShardPath(false, path, path, shardId), stats, null, seqNoStats, null));
}
}

Expand Down

0 comments on commit 5236fc3

Please sign in to comment.