Skip to content

Commit

Permalink
added some time between msg arrival in close in test to make sure ack…
Browse files Browse the repository at this point in the history
…s get to server
  • Loading branch information
Stephen Asbury committed Sep 17, 2018
1 parent 3135852 commit d46527f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/java/io/nats/streaming/SubscribeTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ public void testDurableSubscriberCloseVersusUnsub() throws Exception {
latch.await(5, TimeUnit.SECONDS));
assertEquals("should get first message", 0, received.get());

try {Thread.sleep(2000);} catch(Exception e) {}; // get the ack in the queue
sub.close(); // Should not unsub
sc.getNatsConnection().flush(Duration.ofSeconds(2));
try {Thread.sleep(2000);} catch(Exception e) {}; // Give the server time to clean up
Expand All @@ -824,6 +825,7 @@ public void testDurableSubscriberCloseVersusUnsub() throws Exception {
latch2.await(5, TimeUnit.SECONDS));
assertEquals("should get second message", 1, received.get());

try {Thread.sleep(2000);} catch(Exception e) {}; // get the ack in the queue
sub2.close(true); // Should unsub
sc.getNatsConnection().flush(Duration.ofSeconds(2));
try {Thread.sleep(2000);} catch(Exception e) {}; // Give the server time to clean up
Expand Down

0 comments on commit d46527f

Please sign in to comment.