Skip to content

Commit 7e91c08

Browse files
committed
Wait deterministically for the configDone future
1 parent 9ceea82 commit 7e91c08

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

adapter/src/test/kotlin/org/javacs/ktda/DebugAdapterTestFixture.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ abstract class DebugAdapterTestFixture(
4747
Thread {
4848
configDone.join()
4949
}.start()
50-
// Add a small delay to ensure that the thread has
51-
// started and is blocked on the future.
52-
Thread.sleep(500)
50+
// Wait until the thread has blocked on the future
51+
while (configDone.numberOfDependents == 0) {
52+
Thread.sleep(100)
53+
}
5354
}
5455
}
5556

0 commit comments

Comments
 (0)