problem: timeout on unit tests

(cherry picked from commit 255a3833fd)
This commit is contained in:
a10zn8
2022-11-17 07:33:03 +04:00
parent 98e20d08be
commit 3a65201f73
2 changed files with 5 additions and 4 deletions

View File

@@ -405,7 +405,8 @@ open class WsConnection(
)
val response = Flux.from(rpcReceive.asFlux())
.doOnSubscribe { sendRpc(request) }
// send the request _after_ WS subscribes to the responses, otherwise the response may come before the actual subscription and be lost
.doOnRequest { sendRpc(request) }
.filter { resp -> resp.id.asNumber() == expectedId }
.take(Defaults.timeout)
.take(1)