Reconnect test fails easier now
This commit is contained in:
parent
8c9140b3f6
commit
e6cc3fd851
@ -141,6 +141,7 @@ class ReconnectTest extends BaseTest {
|
||||
if (useTCP && useUDP) {
|
||||
initialCount += 2;
|
||||
}
|
||||
try {
|
||||
for (int i = 1; i < count + 1; i++) {
|
||||
System.out.println(".....");
|
||||
try {
|
||||
@ -149,9 +150,9 @@ class ReconnectTest extends BaseTest {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
int waitingRetryCount = 20;
|
||||
int target = i * initialCount;
|
||||
boolean failed = false;
|
||||
|
||||
synchronized (receivedCount) {
|
||||
while (this.receivedCount.get() != target) {
|
||||
@ -167,8 +168,10 @@ class ReconnectTest extends BaseTest {
|
||||
|
||||
System.err.println("NOTE: UDP can fail, even on loopback! See: http://www.isoc.org/INET97/proceedings/F3/F3_1.HTM");
|
||||
}
|
||||
stopEndPoints();
|
||||
assertEquals(target, this.receivedCount.get());
|
||||
if (target != this.receivedCount.get()) {
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
try {
|
||||
receivedCount.wait(1000);
|
||||
@ -180,13 +183,19 @@ class ReconnectTest extends BaseTest {
|
||||
|
||||
client.close();
|
||||
System.out.println(".....");
|
||||
|
||||
if (failed) {
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
assertEquals(count * initialCount, this.receivedCount.get());
|
||||
|
||||
} finally {
|
||||
stopEndPoints();
|
||||
waitForThreads(10);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public
|
||||
|
Loading…
Reference in New Issue
Block a user