From 5e83bcbe998fc8859d7b8206ce3c4de62c75fca3 Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Fri, 23 Nov 2018 16:10:42 +0100 Subject: [PATCH] [Tests] Do not use all permits acquisition in replica promotion tests Closes #35850 --- .../elasticsearch/index/shard/IndexShardTests.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index cdc4f79b4eb69..2b89d9de8d31f 100644 --- a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -1023,7 +1023,6 @@ public void testGlobalCheckpointSync() throws IOException { closeShards(replicaShard, primaryShard); } - @AwaitsFix(bugUrl="https://github.com/elastic/elasticsearch/issues/35850") public void testRestoreLocalHistoryFromTranslogOnPromotion() throws IOException, InterruptedException { final IndexShard indexShard = newStartedShard(false); final int operations = 1024 - scaledRandomIntBetween(0, 1024); @@ -1039,7 +1038,7 @@ public void testRestoreLocalHistoryFromTranslogOnPromotion() throws IOException, final Set docsBeforeRollback = getShardDocUIDs(indexShard); final CountDownLatch latch = new CountDownLatch(1); final boolean shouldRollback = Math.max(globalCheckpointOnReplica, globalCheckpoint) < maxSeqNo; - randomReplicaOperationPermitAcquisition(indexShard, + indexShard.acquireReplicaOperationPermit( indexShard.getPendingPrimaryTerm() + 1, globalCheckpoint, maxSeqNoOfUpdatesOrDeletes, @@ -1054,7 +1053,8 @@ public void onResponse(Releasable releasable) { public void onFailure(Exception e) { } - }, ""); + }, + ThreadPool.Names.SAME, ""); latch.await(); if (shouldRollback) { @@ -1088,7 +1088,6 @@ public void onFailure(Exception e) { closeShard(indexShard, false); } - @AwaitsFix(bugUrl="https://github.com/elastic/elasticsearch/issues/35850") public void testRollbackReplicaEngineOnPromotion() throws IOException, InterruptedException { final IndexShard indexShard = newStartedShard(false); @@ -1106,7 +1105,7 @@ public void testRollbackReplicaEngineOnPromotion() throws IOException, Interrupt && indexShard.seqNoStats().getMaxSeqNo() != SequenceNumbers.NO_OPS_PERFORMED; final Engine beforeRollbackEngine = indexShard.getEngine(); final long newMaxSeqNoOfUpdates = randomLongBetween(indexShard.getMaxSeqNoOfUpdatesOrDeletes(), Long.MAX_VALUE); - randomReplicaOperationPermitAcquisition(indexShard, + indexShard.acquireReplicaOperationPermit( indexShard.pendingPrimaryTerm + 1, globalCheckpoint, newMaxSeqNoOfUpdates, @@ -1121,7 +1120,8 @@ public void onResponse(final Releasable releasable) { public void onFailure(final Exception e) { } - }, ""); + }, + ThreadPool.Names.SAME, ""); latch.await(); if (globalCheckpointOnReplica == SequenceNumbers.UNASSIGNED_SEQ_NO && globalCheckpoint == SequenceNumbers.UNASSIGNED_SEQ_NO) {