test: a launchd removal test can refuse the bootout instead of the check after it

Open Beginner friendly
#759 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
testing

Research direction

Start in crates/adapters/platform/src/service/tests.rs at a_removal_whose_check_on_the_stopping_agent_fails_keeps_the_file_and_says_so, and run it alone with cargo nextest run to see the fake harness in action. Read how the fake records a command versus when it decides that command's answer; the test polls every 10 ms for the recorded bootout before arming the refusal. Move the arming so it only affects commands after the bootout (for example, on the bootout's completion), then rerun the test repeatedly to confirm the refusal can no longer land on the bootout itself.

Written by the indexing model from the issue text.

Description

bug priority: low

platform service::tests::a_removal_whose_check_on_the_stopping_agent_fails_keeps_the_file_and_says_so (crates/adapters/platform/src/service/tests.rs) failed once in a full cargo nextest run --workspace on a loaded machine:

left: ManagerRefused { command: "launchctl bootout …", said: "Could not talk to launchd" }

It expects the refusal on the later launchctl print check. Run alone it passed 5 of 5 times, on main and on a branch, and the full rerun passed.

Likely cause [inference]: the test polls every 10 ms for a recorded bootout command, then makes the fake refuse. If the fake records a command before it decides that command's answer, a poll that lands between the two makes the refusal hit the bootout itself. Under load the window is wide enough to hit.

Fix direction: make the refusal apply only to commands after the bootout (for example, the fake refuses from the next command on, or the test arms the refusal on the bootout's completion rather than its recording), so the test can't depend on timing. Test-only.

Dominant language
Rust
Stars
0
Forks
0
Avg merge
56m
Merged PRs (30d)
349

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nledford/Ladderback

All issues in nledford/Ladderback

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.