SparkStructuredStreamingPipelineResult.cancel() requests cancellation asynchronously and sets the state to CANCELLED at once. Per the PipelineResult contract the state should be observed: getState() queries the execution, waitUntilFinish() blocks until the pipeline is actually cancelled on the (mini) cluster, and only then the state becomes CANCELLED.
Changing this touches the shared StructuredStreamingPipelineStateTest, which asserts CANCELLED right after cancel() for the batch path today, and the legacy SparkPipelineResult has the same shape. Scope: runners/spark/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkStructuredStreamingPipelineResult.java and that test.
Follow up from #40103 / Part of #36841
SparkStructuredStreamingPipelineResult.cancel()requests cancellation asynchronously and sets the state to CANCELLED at once. Per thePipelineResultcontract the state should be observed:getState()queries the execution,waitUntilFinish()blocks until the pipeline is actually cancelled on the (mini) cluster, and only then the state becomes CANCELLED.Changing this touches the shared
StructuredStreamingPipelineStateTest, which asserts CANCELLED right aftercancel()for the batch path today, and the legacySparkPipelineResulthas the same shape. Scope:runners/spark/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkStructuredStreamingPipelineResult.javaand that test.Follow up from #40103 / Part of #36841