openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Flaky: harness_embed 100-concurrent-turn 20s budget times out under hosted llvm-cov

Open M3gA-Mind opened this issue 2 months ago • 2 comments

Summary

openhuman-embed tests/harness_embed.rs::a_harness_runs_a_turn_against_the_provider_it_was_given flaked on main in the hosted llvm-cov coverage lane. The same test passed on a re-run of the same commit. Its 20-second budget for 100 concurrent turns is too tight for an instrumented build on a shared hosted runner.

Evidence

Same commit, main 7d8a4c83e, CI Lite run 36459897204, job "Rust Core Coverage (cargo-llvm-cov)" → step "Run complete root Rust suite with cargo llvm-cov" (scripts/ci/rust-coverage.sh, product features):

  • Attempt 1: failed. https://github.com/tinyhumansai/openhuman/actions/runs/36459897204/attempts/1
    panicked at crates/openhuman-embed/tests/harness_embed.rs:173:14:
    100 concurrent turns did not settle within 20 seconds: Elapsed(())
    panicked at crates/openhuman-embed/tests/harness_embed.rs:237:10:
    library host task did not panic: JoinError::Panic(..., "100 concurrent turns did not settle within 20 seconds: Elapsed(())", ...)
    
  • Attempt 2: passed, same commit (job 109089246347): test a_harness_runs_a_turn_against_the_provider_it_was_given ... ok. https://github.com/tinyhumansai/openhuman/actions/runs/36459897204/attempts/2

The same test also passed:

  • in main's previous coverage run (cef43b2d8);
  • in the non-instrumented "Test embedding facade" step at 7d8a4c83e;
  • on the EX63 nextest PR runs of both changes merged in between: #6749 (run 36444406791) and #6754 (run 36452723650).

So this is not a regression from those merges; it is instrumentation and runner timing.

Where the budget is

crates/openhuman-embed/tests/harness_embed.rs on main:

  • :154-157 spawns 100 turns into a JoinSet;
  • :165 wraps them in tokio::time::timeout(Duration::from_secs(20), …), which fails with the :173 message;
  • :177 asserts elapsed < Duration::from_secs(20) again.

Neither the passing nor the failing run records the actual duration. :175's eprintln! is captured for a passing test, and the timeout fires before it in a failing one. So the real headroom is unknown.

Suggested direction (maintainer's call)

The test mixes a correctness check (100 concurrent turns all settle and 102 requests reach the provider, :192) with a latency budget. Options, least to most invasive:

  1. Print the elapsed time on both paths, so the next flake shows the actual headroom.
  2. Scale or relax the budget when the build is instrumented (the llvm-cov run sets LLVM_PROFILE_FILE / RUSTFLAGS with -C instrument-coverage), or read the budget from an env var the coverage lane raises.
  3. Keep correctness in this test, and move the latency assertion to a benchmark or a non-instrumented lane.

No product code is implicated.

M3gA-Mind avatar Sep 28 '26 20:09 M3gA-Mind

Flaky test: harness_embed 100-concurrent-turn timeout under coverage instrumentation on shared hosted runner

Labelled priority: p2.

tinysweeper avatar Sep 28 '26 20:09 tinysweeper

Picking this one up. The plan is to keep what the test actually proves — that the hundred turns overlap instead of running one after another — while giving it a much wider margin, so an instrumented build has room to be slow without the check losing its teeth.

obchain avatar Oct 01 '26 10:10 obchain