Skip to content

Commit 6b48233

Browse files
authored
Prevent flaky tests by adding sleep in HttpOverHttp2Test (#9250)
Added a sleep to avoid flaky race conditions in test.
1 parent 7c4b35b commit 6b48233

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

okhttp/src/jvmTest/kotlin/okhttp3/internal/http2/HttpOverHttp2Test.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,8 @@ class HttpOverHttp2Test(
12151215
.isEqualTo(expectedSequenceNumber)
12161216
responseDequeuedLatch!!.await()
12171217
call.cancel()
1218+
// Avoid flaky race conditions
1219+
Thread.sleep(100)
12181220
requestCanceledLatch!!.countDown()
12191221
latch.await()
12201222
}

0 commit comments

Comments
 (0)