This is an automated email from the ASF dual-hosted git repository.
ruifengz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 763106517eca [SPARK-54441][INFRA][FOLLOWUP] Save coverage even when an
exception is raised
763106517eca is described below
commit 763106517ecaa44225936e0db5a135b8eb16329a
Author: Tian Gao <[email protected]>
AuthorDate: Tue Dec 9 14:07:03 2025 +0800
[SPARK-54441][INFRA][FOLLOWUP] Save coverage even when an exception is
raised
### What changes were proposed in this pull request?
Put `cov.save()` in try ... finally ... block to save the report
regardlessly.
### Why are the changes needed?
Currently if the worker raises an exception we just skip saving the report,
so we missed a lot of exception coverage.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
CI should pass and I'll monitor the daily coverage run.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #53399 from gaogaotiantian/coverage-fix.
Authored-by: Tian Gao <[email protected]>
Signed-off-by: Ruifeng Zheng <[email protected]>
---
python/test_coverage/sitecustomize.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/python/test_coverage/sitecustomize.py
b/python/test_coverage/sitecustomize.py
index 6bda12db883d..d6467cfa5029 100644
--- a/python/test_coverage/sitecustomize.py
+++ b/python/test_coverage/sitecustomize.py
@@ -39,8 +39,10 @@ try:
def save_when_exit(func):
def wrapper(*args, **kwargs):
- result = func(*args, **kwargs)
- cov.save()
+ try:
+ result = func(*args, **kwargs)
+ finally:
+ cov.save()
return result
return wrapper
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]