arne-alex commented on code in PR #23333:
URL: https://github.com/apache/beam/pull/23333#discussion_r997813306


##########
runners/google-cloud-dataflow-java/worker/src/test/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorkerTest.java:
##########
@@ -3046,19 +3048,25 @@ public void testHugeCommits() throws Exception {
 
   private static class SlowDoFn extends DoFn<String, String> {
 
+    private final Duration sleep;
+
+    SlowDoFn(Duration sleep) {
+      this.sleep = sleep;
+    }
+
+    SlowDoFn() {
+      this(Duration.millis(1000));
+    }
+
     @ProcessElement
     public void processElement(ProcessContext c) throws Exception {
-      Thread.sleep(1000);
+      Uninterruptibles.sleepUninterruptibly(sleep.getMillis(), 
TimeUnit.MILLISECONDS);

Review Comment:
   This pull request now has another commit that injects a fake 
ScheduledExecutorService, making the new unit tests completely independent from 
the wall-time clock.



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