Merge pull request #92 from p2p-org/revert-88-timeout-tests-ws

Revert "problem: timeout on unit tests"
This commit is contained in:
a10zn8
2022-12-16 15:19:34 +04:00
committed by GitHub
2 changed files with 4 additions and 5 deletions

View File

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

View File

@@ -92,7 +92,7 @@ class WsConnectionSpec extends Specification {
it.id.asNumber() == 15L && Global.objectMapper.readValue(it.result, TransactionJson) == tx it.id.asNumber() == 15L && Global.objectMapper.readValue(it.result, TransactionJson) == tx
} }
.expectComplete() .expectComplete()
.verify(Duration.ofSeconds(1)) .verify(Duration.ofSeconds(5))
} }
def "Makes a RPC call - return null"() { def "Makes a RPC call - return null"() {
@@ -115,7 +115,7 @@ class WsConnectionSpec extends Specification {
it.resultAsRawString == 'null' it.resultAsRawString == 'null'
} }
.expectComplete() .expectComplete()
.verify(Duration.ofSeconds(1)) .verify(Duration.ofSeconds(5))
} }
def "Makes a RPC call - return error"() { def "Makes a RPC call - return error"() {
@@ -140,6 +140,6 @@ class WsConnectionSpec extends Specification {
it.error.code == RpcResponseError.CODE_METHOD_NOT_EXIST && it.error.message == "test" it.error.code == RpcResponseError.CODE_METHOD_NOT_EXIST && it.error.message == "test"
} }
.expectComplete() .expectComplete()
.verify(Duration.ofSeconds(1)) .verify(Duration.ofSeconds(5))
} }
} }