mxtymoshyk opened a new pull request, #40290:
URL: https://github.com/apache/beam/pull/40290

   Fixes #40288.
   
   `PulsarIOTest.testRead` asserted the exact order of the read output:
   
   ```java
   Assert.assertArrayEquals(result.toArray(), new Integer[] {0, 1, 2, 3, 4, 5, 
6, 7, 8, 9});
   ```
   
   A `PCollection` has no order, and `PAssert` passes the elements through a 
GroupByKey. When the DirectRunner checkpoints the splittable read (it does so 
after 1s on a slow runner), the remaining messages come out in a later bundle 
and the order changes. The CI failure (`expected:<1> but was:<0>`, with the 
arguments swapped) had all 10 elements, only in a different order.
   
   This switches to `PAssert.that(pcoll).containsInAnyOrder(0, ..., 9)`, which 
still checks that every message is read exactly once.
   
   Test-only change. `:sdks:java:io:pulsar:test --tests PulsarIOTest` and 
`spotlessJavaCheck` pass locally.
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us 
incorporate your contribution quickly and easily:
   
    - [x] Mention the appropriate issue in your description (for example: 
`addresses #123`), if applicable. This will automatically add a link to the 
pull request in the issue. If you would like the issue to automatically close 
on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
    - [ ] Update `CHANGES.md` with noteworthy changes.
    - [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   See the [Contributor Guide](https://beam.apache.org/contribute) for more 
tips on [how to make review process 
smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to