Initializing Apache Beam Test Pipeline in Scala fails
Asked Answered
E

1

6

When I try to run a test pipeline it raise an error

here is the source code to create the test pipeline:

val p: TestPipeline = TestPipeline.create()

and here is the error :

java.lang.IllegalStateException: Is your TestPipeline declaration missing a @Rule annotation? Usage: @Rule public final transient TestPipeline pipeline = TestPipeline.create();

Emarginate answered 5/8, 2019 at 16:4 Comment(0)
E
12

I have solve the problem by following code :

val p: TestPipeline = TestPipeline.create().enableAbandonedNodeEnforcement(false)
Emarginate answered 5/8, 2019 at 16:5 Comment(1)
I am not sure how enableAbandonedNodeEnforcement solves the problem but note that TestPipeline implements org.junit.rules.TestRule (beam.apache.org/releases/javadoc/2.11.0/org/apache/beam/sdk/…) and therefore should be used as a RulePenalize

© 2022 - 2024 — McMap. All rights reserved.