Skip to content

Make agenticd tests independent of umask and machine load - #159

Merged
tonibergholm-codento merged 2 commits into
mainfrom
robust-startup-socket-tests
Nov 20, 2026
Merged

tonibergholm-codento merged 2 commits into
mainfrom
robust-startup-socket-tests

Conversation

@tonibergholm-codento

Copy link
Copy Markdown
Collaborator

Some agenticd tests failed under a umask of 002, and a few failed now and then under load.

Umask: tests created their temp repo directories with the default umask. Under 002 those directories are 0775, and the daemon correctly refuses a group-writable repo, so 5 of 11 startup_refusal tests failed. The tests now set the modes they depend on. The daemon checks are unchanged.

Load: the socket tests treated "the socket file exists" as "the daemon is accepting". The file appears at bind(), before listen(), so an early connect could be refused. The tests now retry a refused connect until a deadline, and the startup wait is 20 s. A refused connect is never admitted, so the retry cannot affect the connection caps under test.

Proof, before and after:

  • startup_refusal: 6/11 under umask 002, now 11/11 under both 002 and 022.
  • socket_limits_integration: 72/75 under parallel load, now 75/75.
  • approval_key_discovery: 74/75, now 75/75.
  • cargo test --workspace passes under both umasks.

Created with Claude Opus 5.5 and Claude Sonnet 5.5 in Claude Code.

Tests that create a repo directory with tempfile inherited the umask, so
under umask 002 the directory was 0775 and the daemon correctly refused it
as group-writable. Pin the repo directory to 0700 in the startup_refusal,
socket_limits_integration and state_dir tests instead of loosening the
daemon check.

The socket tests also treated "socket file exists" as "daemon is
accepting", but the file appears at bind() before listen(), so connect
could be refused. Retry a refused connect with a bounded deadline in
socket_limits_integration and approval_key_discovery, and give the
socket_limits startup wait 20 s instead of 2.5 s. A refused connect is
never admitted, so the retry cannot affect the connection caps under test.
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 59327685-59c4-4304-91ca-c09d186e2b24
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T12:10:47.205541Z 0b233e1 New commits
🔒 Security Review ✅ Completed 2026-11-20T12:12:26.170803Z 0b233e1 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Later connections in a test must connect on the first attempt, so a real
refusal after the daemon is accepting still fails the test.
@tonibergholm-codento
tonibergholm-codento merged commit 99110ac into main Nov 20, 2026
14 checks passed
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.

1 participant