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

   ### What changes were proposed in this pull request?
   This is a test-only fix that isolates the flake fix from SPARK-55799 for 
`branch-4.1`. `test_data_source_writer_with_logging` asserted exactly two 
`"TestJsonWriter.write: abort test"` log rows. That count is not guaranteed: 
when the first partition is aborted, the executor cancels the remaining tasks, 
so whether the second partition logs before cancellation is time sensitive. The 
assertion is split so abort logs are matched with `dropDuplicates(["msg"])`, 
tolerating either 1 or 2 abort logs.
   
   Note: SPARK-55799 on master also changed 
`python/pyspark/logger/worker_io.py` and added a 
`PythonDataSourceTestsWithSimpleWorker` suite. Those are intentionally **not** 
included here -- the simple-worker suite depends on the `worker_io.py` change, 
and this PR is scoped to just de-flaking the existing test on `branch-4.1`.
   
   ### Why are the changes needed?
   The test is flaky on `branch-4.1` (e.g. [this 
run](https://github.com/apache/spark/actions/runs/28858827107/job/85596316246) 
failed with `[DIFFERENT_ROWS]`, missing the second abort log). master and 
branch-4.2 already carry the fix via SPARK-55799; branch-4.1 was never 
backported.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   Existing `test_data_source_writer_with_logging` in 
`pyspark.sql.tests.test_python_datasource`. The revised assertion passes 
whether the race produces 1 or 2 abort logs.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   Generated-by: Claude Code (Opus 4.8)
   


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