follow-up: harden Unix socket test against AF_UNIX path limits#8
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22fde4aa45
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if len(str(bind_path)) < 100: | ||
| server = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | ||
| try: | ||
| server.bind(str(bind_path)) |
There was a problem hiding this comment.
Restore Windows-safe handling for AF_UNIX bind failures
This server.bind(...) call is now unguarded, so on Windows environments where socket.AF_UNIX exists but binding fails (for example due to platform/socket-path constraints), the test raises OSError and fails instead of continuing without a created socket. The previous version explicitly swallowed bind errors on os.name == "nt", so this change reintroduces platform-specific CI failures for test_backup_skips_venv_symlinks_and_unix_sockets rather than just skipping the socket assertion path.
Useful? React with 👍 / 👎.
Motivation
AF_UNIX path too longfailures on Linux/macOS CI caused by long temporary directories so the test exercises backup behavior reliably.Description
test_backup_skips_venv_symlinks_and_unix_socketsto create a short temporary symlink target and bind the Unix socket through that short path when possible.len(str(bind_path)) < 100) to only attemptAF_UNIXbindwhen the computed path is short enough.exist_ok=Trueand close the test server promptly after bind attempts.Testing
python -m unittest tests.test_core.CodexEnvironmentBackupTests.test_backup_skips_venv_symlinks_and_unix_socketsand it passed (OK).Codex Task