Skip to content

Commit c34e430

Browse files
manuelmenzella-googleManu Menzella
andauthored
fix: deflake SubscriptionPartitionProcessorImplTest (#768)
The test case expects the processor to fail immediately (with deadline of zero) after failing the underlying subscriber. However, the actual failing is done asynchronously. Waiting for a little bit removes the flakiness. Co-authored-by: Manu Menzella <menzella@google.com>
1 parent 236f251 commit c34e430

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pubsublite-beam-io/src/test/java/com/google/cloud/pubsublite/beam/SubscriptionPartitionProcessorImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public void subscriberFailureFails() throws Exception {
139139
processor.start();
140140
subscriber.fail(new CheckedApiException(Code.OUT_OF_RANGE));
141141
ApiException e =
142-
assertThrows(ApiException.class, () -> processor.waitForCompletion(Duration.ZERO));
142+
assertThrows(ApiException.class, () -> processor.waitForCompletion(Duration.millis(10)));
143143
assertEquals(Code.OUT_OF_RANGE, e.getStatusCode().getCode());
144144
}
145145

0 commit comments

Comments
 (0)