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 @@ -2301,10 +2301,18 @@ public static void safeAwait(CyclicBarrier barrier) {
23012301 * flag and asserting that the latch is indeed completed before the timeout.
23022302 */
23032303 public static void safeAwait (CountDownLatch countDownLatch ) {
2304+ safeAwait (countDownLatch , SAFE_AWAIT_TIMEOUT );
2305+ }
2306+
2307+ /**
2308+ * Await on the given {@link CountDownLatch} with a supplied timeout, preserving the thread's interrupt status
2309+ * flag and asserting that the latch is indeed completed before the timeout.
2310+ */
2311+ public static void safeAwait (CountDownLatch countDownLatch , TimeValue timeout ) {
23042312 try {
23052313 assertTrue (
23062314 "safeAwait: CountDownLatch did not reach zero within the timeout" ,
2307- countDownLatch .await (SAFE_AWAIT_TIMEOUT .millis (), TimeUnit .MILLISECONDS )
2315+ countDownLatch .await (timeout .millis (), TimeUnit .MILLISECONDS )
23082316 );
23092317 } catch (InterruptedException e ) {
23102318 Thread .currentThread ().interrupt ();
You can’t perform that action at this time.
0 commit comments