Skip to content

[SPARK-57677][PYTHON][TESTS] Make UDTF cleanup tests tolerate task retries#56755

Open
gaogaotiantian wants to merge 1 commit into
apache:masterfrom
gaogaotiantian:SPARK-57677-udtf-cleanup
Open

[SPARK-57677][PYTHON][TESTS] Make UDTF cleanup tests tolerate task retries#56755
gaogaotiantian wants to merge 1 commit into
apache:masterfrom
gaogaotiantian:SPARK-57677-udtf-cleanup

Conversation

@gaogaotiantian

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

The two UDTF cleanup tests test_udtf_cleanup_with_exception_in_eval and test_udtf_cleanup_with_exception_in_terminate asserted that the file written by the UDTF's cleanup method contained exactly the string "cleanup". This relaxes the assertions to check that "cleanup" is present (and, for the eval test, that "terminate" is not), instead of requiring an exact match.

Why are the changes needed?

A UDTF task may be retried by the scheduler, in which case cleanup runs more than once and the file ends up with multiple "cleanup" strings. The exact-match assertion would then fail. Checking for presence makes the tests robust to retries.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

CI.

Was this patch authored or co-authored using generative AI tooling?

Yes, Claude Code (Opus 4.8 high)

…tries

### What changes were proposed in this pull request?
The two UDTF cleanup tests `test_udtf_cleanup_with_exception_in_eval` and
`test_udtf_cleanup_with_exception_in_terminate` asserted that the file written
by the UDTF's `cleanup` method contained exactly the string `"cleanup"`. This
relaxes the assertions to check that `"cleanup"` is present (and, for the eval
test, that `"terminate"` is not), instead of requiring an exact match.

### Why are the changes needed?
A UDTF task may be retried by the scheduler, in which case `cleanup` runs more
than once and the file ends up with multiple `"cleanup"` strings. The exact-match
assertion would then fail. Checking for presence makes the tests robust to retries.

Co-authored-by: Isaac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant