Eliaaazzz opened a new pull request, #39365:
URL: https://github.com/apache/beam/pull/39365

   Fixes #39332.
   
   On Windows, Gradle forks the test JVM with 
`-DbeamTestPipelineOptions=<compact JSON>` on the command line. 
`ProcessBuilder` only quotes arguments that contain whitespace, so the argument 
is passed unquoted, the Windows C runtime strips the JSON's `"` characters, and 
`TestPipeline.testingPipelineOptions()` fails with `JsonParseException` before 
any pipeline runs. Every test in the task fails at `TestPipeline.create()`.
   
   The repo already handles this in two places by wrapping each option in 
literal quotes so one quoting layer survives: 
`runners/direct-java/build.gradle` 
(`pipelineOptionsStringCrossPlatformHandling`, BEAM-11365) and the inline 
handling in `enableJavaPerformanceTesting` (BEAM-10682). This PR consolidates 
that treatment into a shared static helper `toBeamTestPipelineOptionsJson` in 
`BeamModulePlugin` and applies it to the two ValidatesRunner paths that were 
missing it:
   
   - `createPortableValidatesRunnerTask`
   - `createCrossLanguageValidatesRunnerTask`
   
   The existing inline handling in `enableJavaPerformanceTesting` is refactored 
onto the same helper. On non-Windows platforms the helper emits exactly the 
same JSON as before (`JsonOutput.toJson(options)`), so CI behavior is 
unchanged; the wrapping branch only executes on Windows.
   
   Verified on Windows 11, JDK 11:
   
   - The standalone `ProcessBuilder` reproduction from #39332, using the exact 
options of the Spark portable VR batch task: the current format loses every 
quote in the child JVM; the wrapped format arrives byte-identical to the 
intended JSON.
   - `gradlew :runners:spark:3:job-server:validatesPortableRunnerBatch --tests 
"*SplittableDoFnTest*"`, which previously failed 9/9 with `JsonParseException` 
at `TestPipeline.create()`: after this change the `JsonParseException` count is 
0/9. The forked worker's command line shows the property arriving intact (`jps 
-v`: 
`-DbeamTestPipelineOptions=["--runner=org.apache.beam.runners.portability.testing.TestPortableRunner",...]`),
 and all 9 tests parse their options, create the `TestPipeline`, and submit 
pipelines to the job server. They then hit #39364, a separate pre-existing 
Windows bug in artifact staging that this fix unmasked; this change is a 
prerequisite for any local Java VR signal on Windows.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to