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

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

                Author: ASF GitHub Bot
            Created on: 13/Mar/20 21:52
            Start Date: 13/Mar/20 21:52
    Worklog Time Spent: 10m 
      Work Description: suztomo commented on issue #11090: [BEAM-9470] 
:sdks:java:io:kinesis:test is flaky
URL: https://github.com/apache/beam/pull/11090#issuecomment-598926854
 
 
   In the test case, the two iterators return the following data:
   
   - firstIterator: `throw(e)`;  `[a, b]`;   `[]`;   `[]`;   `[]`;   `[]` ...
   - secondIterator: `[c]`;   `[d]`;   `[]`;   `[]`;   `[]` ...
   
   The test case waits for 5 elements from shardReadersPool:
   
   ```
       List<KinesisRecord> fetchedRecords = new ArrayList<>();
       while (fetchedRecords.size() < 4) {
         CustomOptional<KinesisRecord> nextRecord = 
shardReadersPool.nextRecord();
         if (nextRecord.isPresent()) {
           fetchedRecords.add(nextRecord.get());
         }
       }
   ```
   
   The test's expectation was:
   
   ```
       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)));
   ```
   
   My assumption: there's no guarantee that 2 elements from firstIterator and 
secondIterator are served evenly when 5 elements are consumed.
   
   My suggestion: make the while loop until it confirms the expected 5 elements 
are in `fetchedRecords` variable.
   
    (Sorry if this is missing the point, I wrote this without checking @jfarr 
's updated solution)
 
----------------------------------------------------------------
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:
[email protected]


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

    Worklog Id:     (was: 403193)
    Time Spent: 6h 40m  (was: 6.5h)

> :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: 6h 40m
>  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