Skip to content

CI: no timing in any automatic run; profile only on demand - #40

Merged
MHohlios merged 8 commits into
mainfrom
wiffletree/ci-no-timing-in-any-automatic-run-profile-only-o
Nov 4, 2026
Merged

MHohlios merged 8 commits into
mainfrom
wiffletree/ci-no-timing-in-any-automatic-run-profile-only-o

Conversation

@MHohlios

@MHohlios MHohlios commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Summary

PR checks and releases kept failing on tests that depend on how fast GitHub's runners are, or on how threads get scheduled. Nothing automatic now runs a timing test or the benchmark: they run only in an on-demand Profile workflow. Every remaining test was swept so it waits on a real signal rather than on time. Linear: VYT-264.

Changes

  • Profile, on demand: daily.yml is now profile.yml, named "Profile", with workflow_dispatch only, and it runs on any branch. It keeps the replay benchmark, the comparison (against the last Profile run on main, or else the latest v* tag) and the timing_ tests. Run it from Actions → Profile → Run workflow, or locally on a quiet machine with cargo test --workspace -- --ignored timing_.
  • CI: correctness only, with unchanged job names. Every job gets timeout-minutes (lint 30, build 60, iOS 60).
  • Root cause of "The repo is busy": the git credential helper now starts as /bin/sh rather than sh. With a bare name and PATH set, Rust forks instead of using posix_spawn, and until exec the child held every open file, including other repos' owner locks. On macOS this closes the window; on Linux glibc still copies the file table briefly, so the window only shrinks. Players won't notice the change.
  • Tests made deterministic:
    • registry::what_loads_is_the_copy_that_was_hashed: waits for the first FIFO reader to let go instead of sleeping 300 ms (unix-only libc dev-dependency).
    • logs::writer stuck-disk test: waits for the writer's first write to begin instead of sleeping.
    • sync::refused_repo_leaves_the_vault_alone: relies on in-order commands and the quit's full pass instead of a 300 ms sleep.
    • Three vault tests wait on the state watch for Locked, with a 60 s guard.
    • repo export test: exports until a write has landed.
    • The Argon2 test is split: the thread and full-cost checks stay on PRs; the heartbeat count moves to timing_argon2_never_stalls_the_callers_thread.
    • git reopen() retries for up to 60 s.
  • Hang guards: waits of 1 to 5 s raised to 60 s across core, desktop and avatar tests.
  • Wording: all 16 timing ignores read "timing: runs in the profile".
  • Docs: docs/ci.md says what runs automatically, how to run the profile, and what a test may depend on. The README and docs/releasing.md are updated to match.

Checks

  • cargo fmt --check, clippy (--release --locked -D warnings) and actionlint pass.
  • cargo test --workspace --no-fail-fast --locked passed 5 times in a row under 24 CPU burners on 12 cores, with a second full test run going in parallel: 1,793 passed and 0 failed each time. The tester repeated that independently.
  • Each test changed after review passed 50 of 50 runs under load.

Follow-ups

  • On Linux a credential helper's spawn can still briefly hold owner locks, so a sync can rarely say "The repo is busy" and retry 3 s later; consider closing that window in the product (crates/mudling-core/src/git/credentials.rs:207).

Reviewed with Wiffletree: 1 full review and 3 re-checks, 4 rounds (Tests, Claude, Style)

mhohlios added 8 commits November 3, 2026 15:36
The pathological-pattern ratio test, the hook time-limit tests and the
session quit bound now carry the timing_ prefix and run daily. The matcher
and session tests keep their behaviour checks in pull request CI.
daily.yml becomes profile.yml ("Profile"), started only by hand, on any
branch: the replay benchmark, the comparison and the timing_ tests. CI on
pull requests, main and a release runs no benchmark and no timing test.

Tests that depended on the machine's speed or on thread scheduling:
- A credential helper started as `sh` with PATH set, so Rust forked it,
  and until its exec the child held every repo owner lock the process had
  open; a sync opening a repo then found it busy. It now runs /bin/sh,
  which starts by posix_spawn.
- The registry FIFO test ordered its two writes with a 300 ms sleep; the
  second now waits until the first reader has let go.
- Two vault tests read the state right after a 50 ms timeout, racing the
  vault's thread; they now wait for the lock on the state watch.
- The export test could see the exports end before its first write; the
  exports now go on until a write has finished.
- Polling and read guards of 1 to 5 seconds are now 60-second hang guards.

Ignore reasons now read "timing: runs in the profile".
…ng-in-any-automatic-run-profile-only-o

# Conflicts:
#	crates/mudling-core/src/plugin/matcher.rs
#	crates/mudling-core/src/session.rs
#	crates/mudling-core/tests/luau_hooks.rs
…waits and CI jobs

The refused-repo test slept 300 ms between sync_now and quit; the sync
thread takes commands in order, so it now waits for the thread to end
under the 60 s quit guard instead. The vault tests' waits for a lock end
in a 60 s hang guard, and every CI job has a timeout-minutes. docs/ci.md
says what the release gate checks and what hang guards a test may use,
and the credential helper comment says where posix_spawn closes the
fork window and where it only shrinks it.
push_to_a_stuck_disk slept three flush intervals so the writer thread
would be stuck on the disk before the pushes. The test disk now says
when a write begins, and the test waits for that under a 60 s guard.
…n the profile

argon2_never_stalls_the_callers_thread asserted more than five heartbeats
during Argon2, which depends on the scheduler. The automatic run now checks
that the vault's work runs on its own thread at the full Argon2 cost, and
the heartbeat count moves to a timing_ test. Wrap the README's long line.
@MHohlios
MHohlios merged commit b494ab7 into main Nov 4, 2026
5 checks passed
@MHohlios
MHohlios deleted the wiffletree/ci-no-timing-in-any-automatic-run-profile-only-o branch November 4, 2026 11:11
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