Skip to content

Commit 9ceec87

Browse files
authored
Fix testClusterRecoversAfterExceptionDuringSerialization (#95038)
In #94325 we introduced another forking step when submitting a publication, so we must extend the timeout in this test (and `DEFAULT_CLUSTER_STATE_UPDATE_DELAY`) by `DEFAULT_DELAY_VARIABILITY`. Closes #94905
1 parent 6da08c4 commit 9ceec87

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

server/src/test/java/org/elasticsearch/cluster/coordination/AtomicRegisterCoordinatorTests.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,6 @@ public void testJoiningNodeReceivesFullState() {
165165
}
166166
}
167167

168-
@Override
169-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/94905")
170-
public void testClusterRecoversAfterExceptionDuringSerialization() {}
171-
172168
@Override
173169
protected CoordinatorStrategy getCoordinatorStrategy() {
174170
var atomicRegister = new AtomicRegister();

server/src/test/java/org/elasticsearch/cluster/coordination/CoordinatorTests.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,6 @@ public Iterator<? extends ToXContent> toXContentChunked(ToXContent.Params params
15681568

15691569
}
15701570

1571-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/94905")
15721571
public void testClusterRecoversAfterExceptionDuringSerialization() {
15731572
try (Cluster cluster = new Cluster(randomIntBetween(2, 5))) {
15741573
cluster.runRandomly();
@@ -1584,7 +1583,11 @@ public void testClusterRecoversAfterExceptionDuringSerialization() {
15841583
assertThat(e.getCause().getMessage(), equalTo(BrokenCustom.EXCEPTION_MESSAGE));
15851584
failed.set(true);
15861585
});
1587-
cluster.runFor(2 * DEFAULT_DELAY_VARIABILITY + 1, "processing broken task");
1586+
// allow for forking 3 times:
1587+
// - once onto the master-service thread
1588+
// - once to fork the publication in FakeThreadPoolMasterService
1589+
// - once to fork the publication listener back onto the master-service thread
1590+
cluster.runFor(3 * DEFAULT_DELAY_VARIABILITY + 1, "processing broken task");
15881591
assertTrue(failed.get());
15891592

15901593
cluster.stabilise();

test/framework/src/main/java/org/elasticsearch/cluster/coordination/AbstractCoordinatorTestCase.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ protected static int defaultInt(Setting<Integer> setting) {
212212
return setting.get(Settings.EMPTY);
213213
}
214214

215-
// Updating the cluster state involves up to the following number of delays:
215+
// Updating the cluster state involves the following delays:
216216
// 1. submit the task to the master service
217217
// 2. state publisher task on master
218218
// 3. master sends out PublishRequests to nodes
@@ -221,7 +221,8 @@ protected static int defaultInt(Setting<Integer> setting) {
221221
// 6. nodes apply committed cluster state
222222
// 7. master receives ApplyCommitResponses
223223
// 8. apply committed state on master (last one to apply cluster state)
224-
public static final int CLUSTER_STATE_UPDATE_NUMBER_OF_DELAYS = 8;
224+
// 9. complete the publication listener back on the master service thread
225+
public static final int CLUSTER_STATE_UPDATE_NUMBER_OF_DELAYS = 9;
225226
public static final long DEFAULT_CLUSTER_STATE_UPDATE_DELAY = CLUSTER_STATE_UPDATE_NUMBER_OF_DELAYS * DEFAULT_DELAY_VARIABILITY;
226227

227228
private static final int ELECTION_RETRIES = 10;

0 commit comments

Comments
 (0)