mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-21 05:52:35 +08:00
test(jetbrains): coordinate SSE callback contention
This commit is contained in:
+6
-1
@@ -147,11 +147,16 @@ class KiloConnectionServiceTest {
|
||||
}
|
||||
}
|
||||
|
||||
val entered = CountDownLatch(1)
|
||||
val first = Thread { listener.onEvent(source, null, "first.event", "first") }
|
||||
val second = Thread { listener.onEvent(source, null, "second.event", "second") }
|
||||
val second = Thread {
|
||||
entered.countDown()
|
||||
listener.onEvent(source, null, "second.event", "second")
|
||||
}
|
||||
first.start()
|
||||
assertTrue(blocked.started.await(1, TimeUnit.SECONDS))
|
||||
second.start()
|
||||
assertTrue(entered.await(1, TimeUnit.SECONDS))
|
||||
blocked.release.countDown()
|
||||
first.join()
|
||||
second.join()
|
||||
|
||||
Reference in New Issue
Block a user