You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/03 17:25:43 UTC

[GitHub] [beam] kennknowles opened a new issue, #18342: TestPipeline / PipelineOptionsFactory crashes on to unregistered options

kennknowles opened a new issue, #18342:
URL: https://github.com/apache/beam/issues/18342

   When `TestSparkPipelineOptions` is not registered, this failure occurs on all tests using `TestPipeline`:
   
   ```
   
   java.lang.IllegalArgumentException: Class interface org.apache.beam.sdk.testing.TestPipelineOptions
   missing a property named 'forceStreaming'.
   	at org.apache.beam.sdk.options.PipelineOptionsFactory.parseObjects(PipelineOptionsFactory.java:1573)
   	at
   org.apache.beam.sdk.options.PipelineOptionsFactory.access$400(PipelineOptionsFactory.java:104)
   	at org.apache.beam.sdk.options.PipelineOptionsFactory$Builder.as(PipelineOptionsFactory.java:289)
   	at
   org.apache.beam.sdk.testing.TestPipeline.testingPipelineOptions(TestPipeline.java:403)
   	at org.apache.beam.sdk.testing.TestPipeline.create(TestPipeline.java:264)
   	at
   org.apache.beam.runners.spark.translation.streaming.StreamingSourceMetricsTest.<init>(StreamingSourceMetricsTest.java:49)
   
   ```
   
   
   However, it is (I believe) our recommended best practice to not register such options as they are not intended for users. They should just be "cast" via `as` by the runner that wants to use them. Further, `TestSparkPipelineOptions` cannot be registered due to pulling in a hamcrest dependency (see BEAM-2237).
   
   The user doesn't specify this option, and the runner doesn't mutate it. This should probably not crash.
   
   Imported from Jira [BEAM-2238](https://issues.apache.org/jira/browse/BEAM-2238). Original Jira may contain additional context.
   Reported by: kenn.


-- 
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: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org