Skip to content

Commit

Permalink
fix: make subscriberIT test less flaky (#340)
Browse files Browse the repository at this point in the history
* fix: make subscriberIt less flaky
  • Loading branch information
hannahrogers-google committed Sep 4, 2020
1 parent f379673 commit 5d4f534
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions samples/snippets/src/test/java/pubsub/SubscriberIT.java
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 5d4f534

Please sign in to comment.