Skip to content

Commit e61fccd

Browse files
committed
Fix testMaxBufferLifeTime test
1 parent 9ace4a9 commit e61fccd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/test/kotlin/org/jetbrains/kotlinx/jupyter/test/CapturingStreamTests.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,16 @@ class CapturingStreamTests {
9292
val strings = arrayOf("11", "22", "33", "44", "55", "66")
9393
val expected = arrayOf("1122", "3344", "5566")
9494

95+
val timeDelta = 1000L
9596
val i = AtomicInteger(0)
96-
val s = getStream(maxBufferLifeTimeMs = 1000) {
97+
val s = getStream(maxBufferLifeTimeMs = 2 * timeDelta) {
9798
assertEquals(expected[i.getAndIncrement()], it)
9899
}
99100

101+
Thread.sleep(timeDelta / 2)
100102
strings.forEach {
101-
Thread.sleep(450)
102103
s.write(it.toByteArray())
104+
Thread.sleep(timeDelta)
103105
}
104106

105107
s.flush()

0 commit comments

Comments
 (0)