You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ie...@apache.org on 2017/04/04 07:55:30 UTC

[2/3] beam git commit: Fix style on waitUntilFinish(Duration) test for the DirectRunner The call to .cancel() is removed too, it is apparently unneeded.

Fix style on waitUntilFinish(Duration) test for the DirectRunner
The call to .cancel() is removed too, it is apparently unneeded.


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/866e08f4
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/866e08f4
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/866e08f4

Branch: refs/heads/master
Commit: 866e08f4a11ccc17fc785817582e51f7982b8a7d
Parents: b4541a1
Author: Isma�l Mej�a <ie...@apache.org>
Authored: Tue Apr 4 09:51:58 2017 +0200
Committer: Isma�l Mej�a <ie...@apache.org>
Committed: Tue Apr 4 09:51:58 2017 +0200

----------------------------------------------------------------------
 .../beam/runners/direct/DirectRunnerTest.java   | 24 +++++++++-----------
 1 file changed, 11 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/866e08f4/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerTest.java
----------------------------------------------------------------------
diff --git a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerTest.java b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerTest.java
index f1c0eb2..28c24ad 100644
--- a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerTest.java
+++ b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerTest.java
@@ -278,29 +278,27 @@ public class DirectRunnerTest implements Serializable {
   }
 
   @Test
-  public void waitUntilFinishTimeout() throws Exception {
+  public void testWaitUntilFinishTimeout() throws Exception {
     DirectOptions options = PipelineOptionsFactory.as(DirectOptions.class);
     options.setBlockOnRun(false);
     options.setRunner(DirectRunner.class);
     Pipeline p = Pipeline.create(options);
-    p.apply(Create.of(1L))
-        .apply(
-            ParDo.of(
-                new DoFn<Long, Long>() {
-                  @ProcessElement
-                  public void hang(ProcessContext context) throws InterruptedException {
-                    // Hangs "forever"
-                    Thread.sleep(Long.MAX_VALUE);
-                  }
-                }));
+    p
+      .apply(Create.of(1L))
+      .apply(ParDo.of(
+          new DoFn<Long, Long>() {
+            @ProcessElement
+            public void hang(ProcessContext context) throws InterruptedException {
+              // Hangs "forever"
+              Thread.sleep(Long.MAX_VALUE);
+            }
+          }));
     PipelineResult result = p.run();
     // The pipeline should never complete;
     assertThat(result.getState(), is(State.RUNNING));
     // Must time out, otherwise this test will never complete
     result.waitUntilFinish(Duration.millis(1L));
     assertThat(result.getState(), is(State.RUNNING));
-
-    result.cancel();
   }
 
   @Test