Ensure all temp files are deleted after the compatibility test #886
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
This PR ensures all temp files are removed after the compatibility tests are completed. In the current implementation, some temporary files will not be deleted after the process exits due to:
kuberay/tests/kuberay_utils/utils.py
Line 44 in 683f0fa
With the option
delete=False
, the temporary files will not be deleted after the process exits, and need to be deleted manually. See NamedTemporaryFile for more details. Check/tmp
to see the temporary files after the tests are completed.In this PR, temporary files will be deleted automatically once we close the files. See how NamedTemporaryFile works.
flush
manually. Otherwise, the file will be empty when we try to read it because the flush normally does not happen until the file is closed.try/catch
.RayServiceAddCREvent
andRayClusterAddCREvent
already have the logic to raise and log errors.Related issue number
Checks
Make sure the compatibility tests still work. This can be proven through the CI test.