Skip to content

Commit 33e49a5

Browse files
committed
Increased timeout in ClusterServiceTests.testTimeoutUpdateTask to 100ms
The previous 2ms timeout was too small and caused a racing condition in timeout handling. This will be fixed but requires more work.
1 parent a668cd2 commit 33e49a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/java/org/elasticsearch/cluster/ClusterServiceTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void onFailure(String source, Throwable t) {
8383
clusterService1.submitStateUpdateTask("test2", new TimeoutClusterStateUpdateTask() {
8484
@Override
8585
public TimeValue timeout() {
86-
return TimeValue.timeValueMillis(2);
86+
return TimeValue.timeValueMillis(100);
8787
}
8888

8989
@Override
@@ -102,7 +102,7 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS
102102
}
103103
});
104104

105-
assertThat(timedOut.await(500, TimeUnit.MILLISECONDS), equalTo(true));
105+
assertThat(timedOut.await(1000, TimeUnit.MILLISECONDS), equalTo(true));
106106
block.countDown();
107107
Thread.sleep(100); // sleep a bit to double check that execute on the timed out update task is not called...
108108
assertThat(executeCalled.get(), equalTo(false));

0 commit comments

Comments
 (0)