From a92d616a3eb126c25d11b7562f464b7b2a8a8bbc Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Fri, 27 Mar 2020 10:02:14 -0600 Subject: [PATCH] fix tests --- tests/testinterop.nim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/testinterop.nim b/tests/testinterop.nim index e447cdd..1464c4b 100644 --- a/tests/testinterop.nim +++ b/tests/testinterop.nim @@ -59,9 +59,9 @@ proc readLp*(s: StreamTransport): Future[seq[byte]] {.async, gcsafe.} = result.setLen(size) if size > 0.uint: await s.readExactly(addr result[0], int(size)) - except LPStreamIncompleteError as exc: + except TransportIncompleteError as exc: trace "remote connection ended unexpectedly", exc = exc.msg - except LPStreamReadError as exc: + except TransportError as exc: trace "unable to read from remote connection", exc = exc.msg proc createNode*(privKey: Option[PrivateKey] = none(PrivateKey), @@ -382,10 +382,12 @@ suite "Interop": await daemonNode.connect(nativePeer.peerId, nativePeer.addrs) var stream = await daemonNode.openStream(nativePeer.peerId, protos) - while count < 10: + var count2 = 0 + while count2 < 10: discard await stream.transp.writeLp(test) let line = await stream.transp.readLp() check test == cast[string](line) + inc(count2) result = 10 == (await wait(testFuture, 10.secs)) await nativeNode.stop()