nbali commented on code in PR #22953:
URL: https://github.com/apache/beam/pull/22953#discussion_r964355971


##########
sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/GroupIntoBatchesTest.java:
##########
@@ -675,9 +674,26 @@ public void 
testMultipleLimitsAtOnceInGlobalWindowBatchSizeCountAndBatchSizeByte
             .stream()
             .map(s -> KV.of("key", s))
             .collect(Collectors.toList());
+
+    // to ensure ordered firing
+    TestStream.Builder<KV<String, String>> streamBuilder =
+        TestStream.create(KvCoder.of(StringUtf8Coder.of(), 
StringUtf8Coder.of()))
+            .advanceWatermarkTo(Instant.EPOCH);
+
+    long offset = 0L;
+    for (KV<String, String> kv : dataToUse) {
+      streamBuilder =
+          streamBuilder.addElements(
+              TimestampedValue.of(kv, 
Instant.EPOCH.plus(Duration.standardSeconds(offset))));
+      offset++;
+    }
+
+    // fire them all at once
+    TestStream<KV<String, String>> stream = 
streamBuilder.advanceWatermarkToInfinity();

Review Comment:
   @lukecwik is there any other (so not TestStream+TimestampedValue) simpler 
way to guarantee the order of the elements that I missed?



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