Skip to content

Fix flaky local close-file tests#757

Merged
alamb merged 1 commit into
apache:mainfrom
kevinjqliu:kevinjqliu/codex-fix-local-close-file-test
Jun 17, 2026
Merged

Fix flaky local close-file tests#757
alamb merged 1 commit into
apache:mainfrom
kevinjqliu:kevinjqliu/codex-fix-local-close-file-test

Conversation

@kevinjqliu

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

The close-file error tests tried to force an error by closing a temp file, rebuilding a File from the now-invalid fd/handle, and closing it again. In parallel test runs, that fd/handle value can be reused by another test, causing the close test to unexpectedly succeed or close another test's resource.

This makes CI flaky and has affected two PRs recently:

What changes are included in this PR?

This adds small Unix and Windows helpers for closing raw fd/handle values, and keeps close_file(File) delegating to those helpers.

The close-file error tests now assert the expected invalid fd/handle errors directly, instead of reconstructing a File from a closed resource.

Are there any user-facing changes?

No. This only changes internal test coverage for local filesystem close-error handling.

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good to me -- thank you @kevinjqliu

@alamb alamb merged commit bdc9f63 into apache:main Jun 17, 2026
9 checks passed
@kevinjqliu kevinjqliu deleted the kevinjqliu/codex-fix-local-close-file-test branch June 17, 2026 19:31
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.

2 participants