beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [beam] jfarr commented on a change in pull request #11090: [BEAM-9470] :sdks:java:io:kinesis:test is flaky
Date Wed, 11 Mar 2020 06:11:34 GMT
jfarr commented on a change in pull request #11090: [BEAM-9470] :sdks:java:io:kinesis:test
is flaky

 File path: sdks/java/io/kinesis/src/test/java/org/apache/beam/sdk/io/kinesis/
 @@ -324,10 +325,15 @@ public void shouldCallRateLimitPolicy()
+    ArgumentCaptor<List<KinesisRecord>> recordsCaptor = ArgumentCaptor.forClass(List.class);
+    verify(customRateLimitPolicy, atLeastOnce()).onSuccess(recordsCaptor.capture());
+    List<List<KinesisRecord>> capturedRecords = recordsCaptor.getAllValues();
+    assertThat(capturedRecords).contains(
+        ImmutableList.of(a, b),
+        singletonList(c),
+        singletonList(d),
+        Collections.emptyList()
+    );
-    verify(customRateLimitPolicy).onSuccess(eq(ImmutableList.of(a, b)));
-    verify(customRateLimitPolicy).onSuccess(eq(singletonList(c)));
-    verify(customRateLimitPolicy).onSuccess(eq(singletonList(d)));
 Review comment:
   Thanks, that's how I thought Mockito.verify() worked too but this made me doubt it. I didn't
do any detailed testing, though, so thanks for taking the time to validate. I'm honestly at
a loss for what could be causing intermittent failures then. All I can say is this version
of the test is semantically equivalent and might not be subject to the same failure mode.
I have not been able to reproduce the failure myself.

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

View raw message