File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
test/framework/src/main/java/org/elasticsearch/test Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -2331,10 +2331,18 @@ public static void safeAwait(CyclicBarrier barrier) {
23312331 * flag and asserting that the latch is indeed completed before the timeout.
23322332 */
23332333 public static void safeAwait (CountDownLatch countDownLatch ) {
2334+ safeAwait (countDownLatch , SAFE_AWAIT_TIMEOUT );
2335+ }
2336+
2337+ /**
2338+ * Await on the given {@link CountDownLatch} with a supplied timeout, preserving the thread's interrupt status
2339+ * flag and asserting that the latch is indeed completed before the timeout.
2340+ */
2341+ public static void safeAwait (CountDownLatch countDownLatch , TimeValue timeout ) {
23342342 try {
23352343 assertTrue (
23362344 "safeAwait: CountDownLatch did not reach zero within the timeout" ,
2337- countDownLatch .await (SAFE_AWAIT_TIMEOUT .millis (), TimeUnit .MILLISECONDS )
2345+ countDownLatch .await (timeout .millis (), TimeUnit .MILLISECONDS )
23382346 );
23392347 } catch (InterruptedException e ) {
23402348 Thread .currentThread ().interrupt ();
You can’t perform that action at this time.
0 commit comments