omnigraph/crates/omnigraph-cli/tests
aaltshuler fbc1d3f4ed fix(cli-tests): retry lost port races in the server-spawn harness; surface server stderr
spawn_server_process picked a port by binding :0 and DROPPING the
listener before the spawned omnigraph-server rebound it — a TOCTOU
window in which any concurrently-spawning test steals the port. The
loser exits "address in use", but stderr was nulled, so the test
panicked with a bare "server exited before becoming healthy: exit
status: 1" on whichever parity/system test lost the race that run
(~1-in-2 parallel runs locally; 12/12 pass serially).

Fix, two halves:
- Retry the spawn on a fresh port (up to 5 attempts) when the child
  exits before passing the health check. A lost race becomes invisible;
  a deterministic startup failure still panics loudly after the retries.
- Capture stderr to a temp file (not a pipe, which a chatty healthy
  server would fill and block on; not null) and include it in the panic
  and per-retry messages, so genuine startup failures carry the server's
  own error text.

StdCommand isn't Clone and a reused command would trip clap's
duplicate --bind rejection, so retries respawn via clone_command
(program/args/envs/cwd).

Verified: parity_matrix 3x parallel clean (previously flaked ~every
other run), full omnigraph-cli suite green.
2026-07-03 12:50:58 +03:00
..
support fix(cli-tests): retry lost port races in the server-spawn harness; surface server stderr 2026-07-03 12:50:58 +03:00
cli_cluster.rs rename compiler NanoError and fix cluster config warnings 2026-06-17 23:44:24 +03:00
cli_cluster_e2e.rs feat(cli)!: schema apply refuses a cluster-managed graph (RFC-011 D10) (#253) 2026-06-15 23:11:42 +03:00
cli_data.rs feat(engine): retire commit-graph tables (#311) 2026-06-28 16:49:49 +02:00
cli_queries.rs feat(cli): surface stored-query @description/@instruction in queries list (#280) 2026-06-19 14:26:50 +03:00
cli_schema_config.rs feat(engine): retire commit-graph tables (#311) 2026-06-28 16:49:49 +02:00
parity_matrix.rs feat(cli)!: excise omnigraph.yaml from the CLI; policy/queries tooling reads --cluster (#251) 2026-06-15 21:48:39 +03:00
system_local.rs Fix CI: make policy-load e2e overwrite self-consistent (#317) 2026-06-30 15:41:32 +02:00
system_remote.rs feat(cli)!: excise omnigraph.yaml from the CLI; policy/queries tooling reads --cluster (#251) 2026-06-15 21:48:39 +03:00