mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +00:00
Fix races causing flakes in LibSignalChatConnectionTest.
This commit is contained in:
committed by
Cody Henthorne
parent
d3f622478f
commit
2a767c1e18
@@ -420,10 +420,8 @@ class LibSignalChatConnectionTest {
|
|||||||
var connectionCompletionFuture: CompletableFuture<UnauthenticatedChatConnection>? = null
|
var connectionCompletionFuture: CompletableFuture<UnauthenticatedChatConnection>? = null
|
||||||
every { network.connectUnauthChat(any()) } answers {
|
every { network.connectUnauthChat(any()) } answers {
|
||||||
chatListener = firstArg()
|
chatListener = firstArg()
|
||||||
delay {
|
connectionCompletionFuture = CompletableFuture<UnauthenticatedChatConnection>()
|
||||||
// We do not complete the future, so we stay in the CONNECTING state forever.
|
connectionCompletionFuture!!
|
||||||
connectionCompletionFuture = it
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
sendLatch = CountDownLatch(1)
|
sendLatch = CountDownLatch(1)
|
||||||
|
|
||||||
@@ -447,9 +445,8 @@ class LibSignalChatConnectionTest {
|
|||||||
var connectionCompletionFuture: CompletableFuture<UnauthenticatedChatConnection>? = null
|
var connectionCompletionFuture: CompletableFuture<UnauthenticatedChatConnection>? = null
|
||||||
every { network.connectUnauthChat(any()) } answers {
|
every { network.connectUnauthChat(any()) } answers {
|
||||||
chatListener = firstArg()
|
chatListener = firstArg()
|
||||||
delay {
|
connectionCompletionFuture = CompletableFuture<UnauthenticatedChatConnection>()
|
||||||
connectionCompletionFuture = it
|
connectionCompletionFuture!!
|
||||||
}
|
|
||||||
}
|
}
|
||||||
sendLatch = CountDownLatch(1)
|
sendLatch = CountDownLatch(1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user