Skip to content

Commit 47f92d7

Browse files
committed
testRejectingJoinWithIncompatibleVersion(WithUnrecoveredState) should use immediate priorities
That will prevent race conditions with the join task, causing failures.
1 parent 49279d2 commit 47f92d7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/src/test/java/org/elasticsearch/discovery/zen/NodeJoinControllerTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import org.elasticsearch.cluster.routing.TestShardRouting;
4040
import org.elasticsearch.cluster.routing.UnassignedInfo;
4141
import org.elasticsearch.cluster.service.MasterService;
42+
import org.elasticsearch.common.Priority;
4243
import org.elasticsearch.common.settings.Settings;
4344
import org.elasticsearch.common.unit.TimeValue;
4445
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
@@ -608,7 +609,8 @@ public void testRejectingJoinWithIncompatibleVersion() throws InterruptedExcepti
608609

609610
CountDownLatch latch = new CountDownLatch(1);
610611
// block cluster state
611-
masterService.submitStateUpdateTask("test", new ClusterStateUpdateTask() {
612+
masterService.submitStateUpdateTask("test", new ClusterStateUpdateTask(Priority.IMMEDIATE) {
613+
612614
@Override
613615
public ClusterState execute(ClusterState currentState) throws Exception {
614616
latch.await();
@@ -654,7 +656,7 @@ public void testRejectingJoinWithIncompatibleVersionWithUnrecoveredState() throw
654656

655657
CountDownLatch latch = new CountDownLatch(1);
656658
// block cluster state
657-
masterService.submitStateUpdateTask("test", new ClusterStateUpdateTask() {
659+
masterService.submitStateUpdateTask("test", new ClusterStateUpdateTask(Priority.IMMEDIATE) {
658660
@Override
659661
public ClusterState execute(ClusterState currentState) throws Exception {
660662
latch.await();

0 commit comments

Comments
 (0)