More complete ping test

This commit is contained in:
Robinson 2022-06-11 23:54:23 +02:00
parent c62296edec
commit 06694cc0fb
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C

View File

@ -11,6 +11,7 @@ import org.junit.Assert
import org.junit.Test import org.junit.Test
class PingTest : BaseTest() { class PingTest : BaseTest() {
val counter = atomic(0)
@Test @Test
fun RmiPing() { fun RmiPing() {
setLogLevel(Level.TRACE) setLogLevel(Level.TRACE)
@ -35,9 +36,10 @@ class PingTest : BaseTest() {
repeat(100) { repeat(100) {
ping { ping {
// a ping object is returned, once the round-trip is complete // a ping object is returned, once the round-trip is complete
println(it) val count = counter.getAndIncrement()
println(count)
if (it == 99) { if (count == 99) {
clientSuccess.value = true clientSuccess.value = true
logger.error("out-bound: $outbound") logger.error("out-bound: $outbound")
@ -53,7 +55,7 @@ class PingTest : BaseTest() {
client.connect(LOCALHOST) client.connect(LOCALHOST)
} }
waitForThreads() waitForThreads(500)
Assert.assertTrue(clientSuccess.value) Assert.assertTrue(clientSuccess.value)
} }