Skip to content

Commit a8e5a22

Browse files
authored
[8.17] Increase timeout in indexRandom to 30ses (#127452)
This is a backport of [116126](#116126) [ [122598](#122598) ] closes [126753](#126753)
1 parent 6f004f8 commit a8e5a22

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

muted-tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,6 @@ tests:
220220
- class: org.elasticsearch.xpack.spatial.search.GeoGridAggAndQueryConsistencyIT
221221
method: testGeoShapeGeoHash
222222
issue: https://github.com/elastic/elasticsearch/issues/115664
223-
- class: org.elasticsearch.indices.mapping.UpdateMappingIntegrationIT
224-
issue: https://github.com/elastic/elasticsearch/issues/116126
225223
- class: org.elasticsearch.upgrades.FullClusterRestartIT
226224
method: testSnapshotRestore {cluster=OLD}
227225
issue: https://github.com/elastic/elasticsearch/issues/111777

test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@ public void indexRandom(boolean forceRefresh, boolean dummyDocuments, boolean ma
17971797
}
17981798
}
17991799
for (CountDownLatch operation : inFlightAsyncOperations) {
1800-
safeAwait(operation);
1800+
safeAwait(operation, TEST_REQUEST_TIMEOUT);
18011801
}
18021802
if (bogusIds.isEmpty() == false) {
18031803
// delete the bogus types again - it might trigger merges or at least holes in the segments and enforces deleted docs!

test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,6 +2312,22 @@ public static void safeAwait(CountDownLatch countDownLatch) {
23122312
}
23132313
}
23142314

2315+
/**
2316+
* Await on the given {@link CountDownLatch} with a supplied timeout, preserving the thread's interrupt status
2317+
* flag and asserting that the latch is indeed completed before the timeout.
2318+
*/
2319+
public static void safeAwait(CountDownLatch countDownLatch, TimeValue timeout) {
2320+
try {
2321+
assertTrue(
2322+
"safeAwait: CountDownLatch did not reach zero within the timeout",
2323+
countDownLatch.await(timeout.millis(), TimeUnit.MILLISECONDS)
2324+
);
2325+
} catch (InterruptedException e) {
2326+
Thread.currentThread().interrupt();
2327+
fail(e, "safeAwait: interrupted waiting for CountDownLatch to reach zero");
2328+
}
2329+
}
2330+
23152331
/**
23162332
* Acquire a single permit from the given {@link Semaphore}, with a timeout of {@link #SAFE_AWAIT_TIMEOUT}, preserving the thread's
23172333
* interrupt status flag and asserting that the permit was successfully acquired.

0 commit comments

Comments
 (0)