You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ke...@apache.org on 2017/05/10 21:03:42 UTC

[3/4] beam git commit: Allow any throwable in PAssert to constitute adequate failure

Allow any throwable in PAssert to constitute adequate failure

Currently, some PAssert tests require an AssertionError to be thrown. This
succeeds on all runners only because many gratuitously throw AssertionError
when they don't actually know that an assertion has failed.

The spec is just that a pipeline has to fail. We don't have a good enough story
around exception propagation to have such a strict - and fake - spec. And it
isn't cross-language anyhow FWIW, looking forward to the possibility of running
a PAssert in a pipeline combining multiple SDK harnesses.


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

Branch: refs/heads/master
Commit: 86416752cd023f704ec0eefbb5ecf01f677aeee5
Parents: 16e4c74
Author: Kenneth Knowles <kl...@google.com>
Authored: Mon May 8 20:07:29 2017 -0700
Committer: Kenneth Knowles <kl...@google.com>
Committed: Wed May 10 14:00:03 2017 -0700

----------------------------------------------------------------------
 .../src/test/java/org/apache/beam/sdk/testing/PAssertTest.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/86416752/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/PAssertTest.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/PAssertTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/PAssertTest.java
index 37db4ef..491f001 100644
--- a/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/PAssertTest.java
+++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/PAssertTest.java
@@ -554,7 +554,7 @@ public class PAssertTest implements Serializable {
     // is first caught by JUnit and causes a test failure.
     try {
       pipeline.run();
-    } catch (AssertionError exc) {
+    } catch (Throwable exc) {
       return exc;
     }
     fail("assertion should have failed");