Skip to content

test(core): add seatbelt sem lock tests - #1823

Merged
bolinfest merged 2 commits into
mainfrom
dev/david.hao/add-unit-tests-for-sem_lock-issue
Aug 14, 2025
Merged

bolinfest merged 2 commits into
mainfrom
dev/david.hao/add-unit-tests-for-sem_lock-issue

Conversation

@davidhao3300

@davidhao3300 davidhao3300 commented Aug 4, 2025 •

Copy link
Copy Markdown
Contributor

Summary

  • add a unit test to ensure the macOS seatbelt policy allows POSIX semaphores
  • add a macOS-only test that runs a Python multiprocessing Lock under Seatbelt

Testing

  • cargo test -p codex_core seatbelt_base_policy_allows_ipc_posix_sem --no-fail-fast (failed: failed to download from https://static.crates.io/crates/tokio-stream/0.1.17/download)
  • cargo test -p codex_core seatbelt_base_policy_allows_ipc_posix_sem --no-fail-fast --offline (failed: attempting to make an HTTP request, but --offline was specified)
  • cargo test --all-features --no-fail-fast --offline (failed: attempting to make an HTTP request, but --offline was specified)
  • just fmt (failed: command not found: just)
  • just fix (failed: command not found: just)

Ran tests locally to confirm it passes on master and failed before my previous change


https://chatgpt.com/codex/tasks/task_i_6890f221e0a4833381cfb53e11499bcc

@davidhao3300 davidhao3300 added the codex Label used by connector to tag PRs that have been reviewed by Codex label Aug 4, 2025 — with ChatGPT Codex Connector
@davidhao3300
davidhao3300 marked this pull request as ready for review August 4, 2025 18:27
@davidhao3300
davidhao3300 requested a review from bolinfest August 4, 2025 18:27

@bolinfest bolinfest left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, this test is helpful and well written! Though can we please update it as described so that we can be certain the resulting behavior is the same on Linux. (Or if it isn't, we may have to update how we use Landlock.)

}

#[test]
fn seatbelt_base_policy_allows_ipc_posix_sem() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This test can be removed.

@bolinfest

Copy link
Copy Markdown
Collaborator

I'll merge and make changes...

@bolinfest
bolinfest merged commit 992e81d into main Aug 14, 2025
@bolinfest
bolinfest deleted the dev/david.hao/add-unit-tests-for-sem_lock-issue branch August 14, 2025 21:23
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 14, 2025
@bolinfest

Copy link
Copy Markdown
Collaborator

Follow-up in #2317.

@bolinfest

Copy link
Copy Markdown
Collaborator

#2318 is the PR that attempts to port this test to Linux, as well.

@bolinfest

Copy link
Copy Markdown
Collaborator

Should be in the PR body, but this test was a follow-up to #1808.

@davidhao3300

Copy link
Copy Markdown
Contributor Author

Thanks for handling, I definitely missed the PR comment and don't regularly check PRs outside of our main repo...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

codex Label used by connector to tag PRs that have been reviewed by Codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants