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
|
||||
every { network.connectUnauthChat(any()) } answers {
|
||||
chatListener = firstArg()
|
||||
delay {
|
||||
// We do not complete the future, so we stay in the CONNECTING state forever.
|
||||
connectionCompletionFuture = it
|
||||
}
|
||||
connectionCompletionFuture = CompletableFuture<UnauthenticatedChatConnection>()
|
||||
connectionCompletionFuture!!
|
||||
}
|
||||
sendLatch = CountDownLatch(1)
|
||||
|
||||
@@ -447,9 +445,8 @@ class LibSignalChatConnectionTest {
|
||||
var connectionCompletionFuture: CompletableFuture<UnauthenticatedChatConnection>? = null
|
||||
every { network.connectUnauthChat(any()) } answers {
|
||||
chatListener = firstArg()
|
||||
delay {
|
||||
connectionCompletionFuture = it
|
||||
}
|
||||
connectionCompletionFuture = CompletableFuture<UnauthenticatedChatConnection>()
|
||||
connectionCompletionFuture!!
|
||||
}
|
||||
sendLatch = CountDownLatch(1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user