Skip to content

test(node): widen the time budget in the unaffordable re-probe test - #594

Open
beardthelion wants to merge 1 commit into
mainfrom
fix/store-probe-test-budget-margin
Open

beardthelion wants to merge 1 commit into
mainfrom
fix/store-probe-test-budget-margin

Conversation

@beardthelion

Copy link
Copy Markdown
Collaborator

Summary

absent_probe_skips_a_reprobe_it_cannot_afford now uses a 2s budget and a 1.2s fake probe instead of 1s and 0.9s, so exec and scheduling latency under load no longer pushes the first probe past its deadline.

Motivation & context

The fake git sleeps 0.9s against a 1s budget, leaving 0.1s for process start and scheduling. Under load the first probe itself crosses the deadline, the watchdog reaps it, and the call takes about 2.05s instead of about 1s. The overshoot assertion fails with one spawn. I saw this twice in local loaded runs (2.047s and 2.060s). It has not failed in the CI logs I checked.

Kind of change

  • Bug fix
  • Feature
  • Security fix
  • Docs
  • Tests / CI
  • Refactor (no behavior change)
  • Breaking or protocol change (issue required first)

What changed

  • gitlawb-node: in git/store.rs, the test's fake probe sleeps 1.2s and the budget is 2s, with a comment on the margin. The re-probe is still unaffordable (more than half the budget is gone), and the slack before the first probe times out goes from 0.1s to 0.8s.

How a reviewer can verify

cargo test --locked -p gitlawb-node --lib git::store::tests::absent_probe_skips_a_reprobe_it_cannot_afford

Passes on an idle machine either way. To see the difference, add sleep 0.2 at the top of the fake script (simulated startup latency). With the old values the test then fails 3 of 3 runs (elapsed about 2.03s); with the new values it passes 3 of 3. The test still guards the affordability check: with the first_probe_took check in object_type_bounded disabled, the new version fails with a second spawn (left: 2).

Before you request review

  • Scope is one logical change; no unrelated churn
  • cargo test --workspace passes locally
  • New behavior is covered by tests (required for fixes)
  • cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings are clean
  • Commit titles use Conventional Commits (feat(...), fix(...), docs(...))
  • Docs / .env.example updated if behavior or config changed (or N/A)
  • Checked existing PRs so this isn't a duplicate

Protocol & signing impact

  • Touches DID / did:key, Ed25519 / RFC 9421 signatures, UCAN, ref certs, or P2P wire formats
  • Discussed in an issue before implementation
  • Backward-compatible with existing nodes and previously signed history

None of these apply: the change is inside a test module and touches no protocol code.

Notes for reviewers

I did not run the full workspace tests on this branch. I ran git::store::tests (all passing), cargo fmt --all -- --check, and clippy with -D warnings on gitlawb-node only, so the clippy box is unticked. The new-tests box is unticked because this changes a test and adds no behavior.

The latency injection simulates load; it is not a captured CI failure. The test has never failed in the CI logs I checked.

Under a heavier local load (busy loops plus a high test thread count on the git:: tests), other process-timing tests in visibility_pack.rs and smart_http.rs also failed. I have not looked at those and they are not changed here.

absent_probe_skips_a_reprobe_it_cannot_afford ran a fake git that sleeps 0.9s
against a 1s budget, leaving 0.1s for exec and scheduling. Under load the first
probe itself crossed the deadline, the watchdog reaped it, and the call took
about 2.05s, failing the overshoot assertion with one spawn.

Use a 2s budget and a 1.2s sleep. The re-probe is still unaffordable (more than
half the budget is gone) and the slack before the first probe times out is 0.8s.
With 0.2s of simulated startup latency the old values failed 3 of 3 runs and
the new ones passed 3 of 3. With the affordability check disabled the new test
fails with a second spawn, so it still guards the check.
@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: 8ad24ed0-05b6-4721-8d92-92636e3ff608
Commits

Reviewing files that changed from the base of the PR and between d4895ef and c7f4728.

Files selected for processing: 1

  • crates/gitlawb-node/src/git/store.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

This branch has not been deployed

No deployments
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