You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuweni.apache.org by to...@apache.org on 2020/02/08 21:28:21 UTC

[incubator-tuweni] branch master updated: Fix flaky test

This is an automated email from the ASF dual-hosted git repository.

toulmean pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git


The following commit(s) were added to refs/heads/master by this push:
     new 1ed7577  Fix flaky test
1ed7577 is described below

commit 1ed757783019e397c5d6e1c29e20163da42abd4f
Author: Antoine Toulme <an...@lunar-ocean.com>
AuthorDate: Sat Feb 8 13:28:09 2020 -0800

    Fix flaky test
---
 .../org/apache/tuweni/hobbits/HobbitsTransportTest.kt   | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/hobbits/src/test/kotlin/org/apache/tuweni/hobbits/HobbitsTransportTest.kt b/hobbits/src/test/kotlin/org/apache/tuweni/hobbits/HobbitsTransportTest.kt
index c527a22..6088852 100644
--- a/hobbits/src/test/kotlin/org/apache/tuweni/hobbits/HobbitsTransportTest.kt
+++ b/hobbits/src/test/kotlin/org/apache/tuweni/hobbits/HobbitsTransportTest.kt
@@ -70,12 +70,15 @@ class HobbitsTransportTest {
       it.handler {
           completion.complete(Bytes.wrapBuffer(it))
       }
-    }.listen(0, "localhost")
-    val server = HobbitsTransport(vertx)
-    server.start()
-    val msg = Message(protocol = Protocol.RPC, headers = Bytes.EMPTY, body = Bytes.EMPTY)
-    server.sendMessage(msg, Transport.TCP, "localhost", listening.actualPort())
-    val result = completion.await()
-    assertEquals(msg.toBytes(), result)
+    }.listen(0, "localhost") {
+      runBlocking {
+        val server = HobbitsTransport(vertx)
+        server.start()
+        val msg = Message(protocol = Protocol.RPC, headers = Bytes.EMPTY, body = Bytes.EMPTY)
+        server.sendMessage(msg, Transport.TCP, "localhost", listening.actualPort())
+        val result = completion.await()
+        assertEquals(msg.toBytes(), result)
+      }
+    }
   }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tuweni.apache.org
For additional commands, e-mail: commits-help@tuweni.apache.org