kuberay
kuberay copied to clipboard
[Bug] Tests for Redis cleanup should not be in the tearDown hook
Search before asking
- [X] I searched the issues and found no similar issues.
KubeRay Component
ci
What happened + What you expected to happen
https://github.com/ray-project/kuberay/pull/1989#issuecomment-1996185753
Reproduction script
https://github.com/ray-project/kuberay/pull/1989#issuecomment-1996185753
Anything else
No response
Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
cc @rueian
Hi @kevin85421, I have opened the PR #2026 to address part of this issue. I added a new cleanup procedure to the compatibility e2e test in the PR as we discussed offline.
The current one in the tearDown hook doesn’t fail the test when needed because the hook catches all exceptions: https://github.com/ray-project/kuberay/blob/522807d64a7e00aadde4242f7b139d8db297b434/tests/framework/prototype.py#L590-L595
Indeed, testing redis cleanup in the tearDown looks weird, but given that it is not the only test we have during tearing down, the next step, I think, is that we should re-raise exceptions from the hook or rewrite all tests in the hook, for example moving them to normal test functions.