Skip to content
Permalink
Browse files
fix: make subscriberIT test less flaky (#340)
* fix: make subscriberIt less flaky
  • Loading branch information
hannahrogers-google committed Sep 4, 2020
1 parent f379673 commit 5d4f5345b13171a47f022d34d39609c2f4329069
Showing with 4 additions and 4 deletions.
  1. +4 −4 samples/snippets/src/test/java/pubsub/SubscriberIT.java
@@ -165,19 +165,19 @@ public void testSubscriber() throws Exception {
assertThat(bout.toString()).contains("Data: Hello " + i);
}

publishSomeMessages(10);
publishSomeMessages(3);
bout.reset();
// Test subscribe synchronously.
SubscribeSyncExample.subscribeSyncExample(projectId, subscriptionId, 10);
for (int i = 0; i < 10; i++) {
for (int i = 0; i < 3; i++) {
assertThat(bout.toString()).contains("Hello " + i);
}

publishSomeMessages(10);
publishSomeMessages(3);
bout.reset();
// Test subscribe synchronously with lease management.
SubscribeSyncWithLeaseExample.subscribeSyncWithLeaseExample(projectId, subscriptionId, 10);
for (int i = 0; i < 10; i++) {
for (int i = 0; i < 3; i++) {
assertThat(bout.toString()).contains("Hello " + i);
}
}

0 comments on commit 5d4f534

Please sign in to comment.