[ 
https://issues.apache.org/jira/browse/BEAM-3525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16339577#comment-16339577
 ] 

ASF GitHub Bot commented on BEAM-3525:
--------------------------------------

pgerv12 closed pull request #4478: [BEAM-3525] Fix serialization of 
PipelineOptions in TestPipeline#run()
URL: https://github.com/apache/beam/pull/4478
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/TestPipeline.java 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/TestPipeline.java
index f2729e976a5..0955b4e4220 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/TestPipeline.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/TestPipeline.java
@@ -350,12 +350,9 @@ public PipelineResult run(PipelineOptions options) {
     final PipelineResult pipelineResult;
     try {
       enforcement.get().beforePipelineExecution();
-      PipelineOptions updatedOptions =
-          MAPPER.convertValue(MAPPER.valueToTree(options), 
PipelineOptions.class);
-      updatedOptions
-          .as(TestValueProviderOptions.class)
+      options.as(TestValueProviderOptions.class)
           
.setProviderRuntimeValues(StaticValueProvider.of(providerRuntimeValues));
-      pipelineResult = super.run(updatedOptions);
+      pipelineResult = super.run(options);
       verifyPAssertsSucceeded(this, pipelineResult);
     } catch (RuntimeException exc) {
       Throwable cause = exc.getCause();


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> TestPipeline serializes PipelineOptions prematurely
> ---------------------------------------------------
>
>                 Key: BEAM-3525
>                 URL: https://issues.apache.org/jira/browse/BEAM-3525
>             Project: Beam
>          Issue Type: Bug
>          Components: testing
>    Affects Versions: 2.2.0
>            Reporter: Paul Gerver
>            Assignee: Paul Gerver
>            Priority: Minor
>
> The TestPipeline in its run() method now serializes PipelineOptions and adds 
> in TestValueProvider values before submitting the pipeline to run [1].
> This premature serialization can cause options marked with JsonIgnore 
> annotations to be dropped before a runner has had a chance to see those 
> parameters. For example, take the FlinkRunner options, if flinkMaster is 
> marked with JsonIgnore because that information is only needed by the runner 
> submitting the job and is not needed during runtime, tests will be run 
> locally incorrectly instead of against the Flink cluster.
> [1] 
> https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/TestPipeline.java#L354



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to