* [ML] making test more determinate * unmuting test
This commit is contained in:
parent
03839ba1a2
commit
88f510ffc2
|
@ -82,7 +82,6 @@ public class DataFrameTransformsCheckpointServiceTests extends ESTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/40368")
|
|
||||||
public void testExtractIndexCheckpointsInconsistentGlobalCheckpoints() {
|
public void testExtractIndexCheckpointsInconsistentGlobalCheckpoints() {
|
||||||
Map<String, long[]> expectedCheckpoints = new HashMap<>();
|
Map<String, long[]> expectedCheckpoints = new HashMap<>();
|
||||||
Set<String> indices = randomUserIndices();
|
Set<String> indices = randomUserIndices();
|
||||||
|
@ -141,9 +140,19 @@ public class DataFrameTransformsCheckpointServiceTests extends ESTestCase {
|
||||||
// we need at least one replica for testing
|
// we need at least one replica for testing
|
||||||
int numShardCopies = randomIntBetween(2, 4);
|
int numShardCopies = randomIntBetween(2, 4);
|
||||||
|
|
||||||
|
int primaryShard = 0;
|
||||||
|
if (skipPrimaries) {
|
||||||
|
primaryShard = randomInt(numShardCopies - 1);
|
||||||
|
}
|
||||||
int inconsistentReplica = -1;
|
int inconsistentReplica = -1;
|
||||||
if (inconsistentGlobalCheckpoints) {
|
if (inconsistentGlobalCheckpoints) {
|
||||||
inconsistentReplica = randomIntBetween(0, numShardCopies - 1);
|
List<Integer> replicas = new ArrayList<>(numShardCopies - 1);
|
||||||
|
for (int i = 0; i < numShardCopies; i++) {
|
||||||
|
if (primaryShard != i) {
|
||||||
|
replicas.add(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
inconsistentReplica = randomFrom(replicas);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SeqNoStats asserts that checkpoints are logical
|
// SeqNoStats asserts that checkpoints are logical
|
||||||
|
@ -156,11 +165,7 @@ public class DataFrameTransformsCheckpointServiceTests extends ESTestCase {
|
||||||
|
|
||||||
for (int replica = 0; replica < numShardCopies; replica++) {
|
for (int replica = 0; replica < numShardCopies; replica++) {
|
||||||
ShardId shardId = new ShardId(index, shardIndex);
|
ShardId shardId = new ShardId(index, shardIndex);
|
||||||
boolean primary = (replica == 0);
|
boolean primary = (replica == primaryShard);
|
||||||
|
|
||||||
if (skipPrimaries) {
|
|
||||||
primary = randomBoolean();
|
|
||||||
}
|
|
||||||
|
|
||||||
Path path = createTempDir().resolve("indices").resolve(index.getUUID()).resolve(String.valueOf(shardIndex));
|
Path path = createTempDir().resolve("indices").resolve(index.getUUID()).resolve(String.valueOf(shardIndex));
|
||||||
ShardRouting shardRouting = ShardRouting.newUnassigned(shardId, primary,
|
ShardRouting shardRouting = ShardRouting.newUnassigned(shardId, primary,
|
||||||
|
|
Loading…
Reference in New Issue