File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -511,12 +511,13 @@ public void testGetStepMultithreaded() throws Exception {
511511
512512 // now, in another thread, update the registry repeatedly as fast as possible.
513513 // updating the registry has the side effect of clearing the cache.
514- new Thread (() -> {
514+ Thread t = new Thread (() -> {
515515 latch .countDown (); // signal that we're starting
516516 while (done .get () == false ) {
517517 registry .update (meta );
518518 }
519- }).start ();
519+ });
520+ t .start ();
520521
521522 try {
522523 latch .await (); // wait until the other thread started
@@ -530,8 +531,9 @@ public void testGetStepMultithreaded() throws Exception {
530531 assertThat (actualStep .getKey (), equalTo (step .getKey ()));
531532 }
532533 } finally {
533- // tell the other thread we're finished
534+ // tell the other thread we're finished and wait for it to die
534535 done .set (true );
536+ t .join (1000 );
535537 }
536538 }
537539}
You can’t perform that action at this time.
0 commit comments