diff --git a/libsignal-service/src/test/java/org/whispersystems/signalservice/internal/websocket/LibSignalChatConnectionTest.kt b/libsignal-service/src/test/java/org/whispersystems/signalservice/internal/websocket/LibSignalChatConnectionTest.kt index d117cc0576..1221a72f27 100644 --- a/libsignal-service/src/test/java/org/whispersystems/signalservice/internal/websocket/LibSignalChatConnectionTest.kt +++ b/libsignal-service/src/test/java/org/whispersystems/signalservice/internal/websocket/LibSignalChatConnectionTest.kt @@ -420,10 +420,8 @@ class LibSignalChatConnectionTest { var connectionCompletionFuture: CompletableFuture? = 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() + connectionCompletionFuture!! } sendLatch = CountDownLatch(1) @@ -447,9 +445,8 @@ class LibSignalChatConnectionTest { var connectionCompletionFuture: CompletableFuture? = null every { network.connectUnauthChat(any()) } answers { chatListener = firstArg() - delay { - connectionCompletionFuture = it - } + connectionCompletionFuture = CompletableFuture() + connectionCompletionFuture!! } sendLatch = CountDownLatch(1)