[ 
https://issues.apache.org/jira/browse/BEAM-9470?focusedWorklogId=401192&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-401192
 ]

ASF GitHub Bot logged work on BEAM-9470:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Mar/20 04:10
            Start Date: 11/Mar/20 04:10
    Worklog Time Spent: 10m 
      Work Description: suztomo commented on pull request #11090: [BEAM-9470] 
:sdks:java:io:kinesis:test is flaky
URL: https://github.com/apache/beam/pull/11090#discussion_r390736457
 
 

 ##########
 File path: 
sdks/java/io/kinesis/src/test/java/org/apache/beam/sdk/io/kinesis/ShardReadersPoolTest.java
 ##########
 @@ -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).onThrottle(same(e));
-    verify(customRateLimitPolicy).onSuccess(eq(ImmutableList.of(a, b)));
-    verify(customRateLimitPolicy).onSuccess(eq(singletonList(c)));
-    verify(customRateLimitPolicy).onSuccess(eq(singletonList(d)));
 
 Review comment:
   Thank you for response. I still need your help here. Mockito is not supposed 
to check the order of the method calls (unless [configured to use 
inOrde](https://stackoverflow.com/questions/21901368/mockito-verify-order-sequence-of-method-calls)r).
 I checked its behavior with the following code:
   <img width="1019" alt="Screen Shot 2020-03-11 at 12 03 34 AM" 
src="https://user-images.githubusercontent.com/28604/76381431-da928380-632b-11ea-97d1-0fc0bac12083.png";>
   
   Do you know something special in this test case that makes mockito's 
`verify` order sensitive?
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 401192)
    Time Spent: 1.5h  (was: 1h 20m)

> :sdks:java:io:kinesis:test is flaky
> -----------------------------------
>
>                 Key: BEAM-9470
>                 URL: https://issues.apache.org/jira/browse/BEAM-9470
>             Project: Beam
>          Issue Type: Test
>          Components: io-java-kinesis
>            Reporter: Etienne Chauchot
>            Assignee: Jonothan Farr
>            Priority: Major
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> [https://scans.gradle.com/s/b4jmmu72ku5jc/console-log?task=:sdks:java:io:kinesis:test]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to