[
https://issues.apache.org/jira/browse/BEAM-2238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17131947#comment-17131947
]
Beam JIRA Bot commented on BEAM-2238:
-------------------------------------
This issue is P2 but has been unassigned without any comment for 60 days so it
has been labeled "stale-P2". If this issue is still affecting you, we care!
Please comment and remove the label. Otherwise, in 14 days the issue will be
moved to P3.
Please see https://beam.apache.org/contribute/jira-priorities/ for a detailed
explanation of what these priorities mean.
> TestPipeline / PipelineOptionsFactory crashes on to unregistered options
> ------------------------------------------------------------------------
>
> Key: BEAM-2238
> URL: https://issues.apache.org/jira/browse/BEAM-2238
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Reporter: Kenneth Knowles
> Priority: P2
> Labels: stale-P2
>
> When {{TestSparkPipelineOptions}} is not registered, this failure occurs on
> all tests using {{TestPipeline}}:
> {code}
> 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)
> {code}
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)