Skip to content

[Data] Fix test_binary setup fixture that doesn't close file handles #54028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 28, 2025

Conversation

bveeramani
Copy link
Member

Why are these changes needed?

The gen_bin_files test utility doesn't properly close file handles. This recently led to janky test behavior, so I'm fixing it in this PR.

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Balaji Veeramani <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings June 24, 2025 00:55
@bveeramani bveeramani requested a review from a team as a code owner June 24, 2025 00:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes a test utility in gen_bin_files so that file handles are properly closed after writing binary files.

  • Wraps the open call in a context manager to ensure files are closed.
  • No functional behavior changes beyond resource cleanup.

@bveeramani bveeramani enabled auto-merge (squash) June 24, 2025 04:16
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Jun 24, 2025
@github-actions github-actions bot disabled auto-merge June 24, 2025 16:58
@bveeramani bveeramani merged commit a60ff51 into master Jun 28, 2025
5 checks passed
@bveeramani bveeramani deleted the dejank-test-binary branch June 28, 2025 00:04
lk-chen pushed a commit to alexeykudinkin/ray that referenced this pull request Jun 29, 2025
ray-project#54028)

<!-- Thank you for your contribution! Please review
https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before
opening a pull request. -->

<!-- Please add a reviewer to the assignee section when you create a PR.
If you don't have the access to it, we will shortly find a reviewer and
assign them to your PR. -->

## Why are these changes needed?

<!-- Please give a short summary of the change and the problem this
solves. -->

The `gen_bin_files` test utility doesn't properly close file handles.
This recently led to janky test behavior, so I'm fixing it in this PR.

## Related issue number

<!-- For example: "Closes ray-project#1234" -->

## Checks

- [ ] I've signed off every commit(by using the -s flag, i.e., `git
commit -s`) in this PR.
- [ ] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I
added a
method in Tune, I've added it in `doc/source/tune/api/` under the
           corresponding `.rst` file.
- [ ] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
   - [ ] Unit tests
   - [ ] Release tests
   - [ ] This PR is not tested :(

Signed-off-by: Balaji Veeramani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants