manuzhang opened a new pull request, #57884:
URL: https://github.com/apache/spark/pull/57884

   ### What changes were proposed in this pull request?
   
   This pull request updates `SparkSessionJobTaggingAndCancellationSuite` so 
its test listener increments `jobEnded` before releasing the semaphore that 
wakes the test thread.
   
   ### Why are the changes needed?
   
   `Semaphore.release()` could wake the test thread before 
`jobEnded.incrementAndGet()` completed. The test could then observe the 
previous counter value and fail intermittently with `2 did not equal 3`.
   
   Updating the counter before releasing the semaphore establishes the required 
ordering between the listener callback and the waiting test thread.
   
   JIRA: https://issues.apache.org/jira/browse/SPARK-58681
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   The affected existing test passed twice with:
   
   ```
   build/sbt 'sql/testOnly 
org.apache.spark.sql.SparkSessionJobTaggingAndCancellationSuite -- -z 
"Cancellation APIs in SparkSession are isolated"'
   ```
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Codex (GPT-5)
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to