zhengruifeng opened a new pull request, #42891: URL: https://github.com/apache/spark/pull/42891
### What changes were proposed in this pull request? - Introduce a parameterized decorator for test retry - Retry `test_read_images` if it fails ### Why are the changes needed? previously, we used `utils.condition` to retry flaky tests, e.g. https://github.com/apache/spark/commit/745ed93fe451b3f9e8148b06356c28b889a4db5a however, it needs to modify the test body. To minimize the changes, I'd like to add a decorator for test retry. recently, I see `test_read_images` fail multiple times, e.g. https://github.com/apache/spark/actions/runs/6155818962/job/16703369881 ### Does this PR introduce _any_ user-facing change? no, test-only ### How was this patch tested? manually test random case: ``` @retry(maxTries=50) def test_rand(self): import random self.assertTrue(random.random() < 0.1) ``` in the log: ``` The 1-th attempt failed, due to False is not true! The 2-th attempt failed, due to False is not true! The 3-th attempt failed, due to False is not true! The 4-th attempt failed, due to False is not true! The 5-th attempt failed, due to False is not true! The 6-th attempt failed, due to False is not true! The 7-th attempt failed, due to False is not true! The 8-th attempt failed, due to False is not true! The 9-th attempt failed, due to False is not true! The 10-th attempt failed, due to False is not true! The 11-th attempt failed, due to False is not true! ok (11.055s) ``` ### Was this patch authored or co-authored using generative AI tooling? no -- 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]
