arne-alex commented on code in PR #23333:
URL: https://github.com/apache/beam/pull/23333#discussion_r995470189
##########
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:
Injecting a fake clock works, but the unit tests still depend on the wall
clock via Timer or ScheduledExecutorService. A fake ScheduledExecutorService is
work in progress.
--
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]