Skip to content

test: MCP-to-browser propagation test fails on timing under load #1046

Done

Description

@bpowers

The simlin-serve test that checks an MCP edit reaches the browser fails now and then on timing alone.
It asserts the round trip takes under 2 s, and that time includes a debug-build server parsing, compiling, and writing the model while the rest of cargo test runs alongside it.
The test should check that the event arrives and is correct, not how fast.

Example

Seen once in the pre-commit hook, on a branch that did not touch simlin-serve; it passed on rerun:

MCP edit -> browser WS propagation must be under 2s (AC5.3 budget + 1s slack); observed 2.24s

The projectChanged event had arrived with the right source, path, and version before the timing assertion failed.

Why it matters

A red pre-commit hook on correct code blocks the commit and teaches people to rerun until green.
It is the only elapsed-time assertion in the simlin-serve tests; the others wait for an event with a timeout that trips only if it never arrives.

Fix

Delete the edit_started / propagation measurement and its assertion, and give the WebSocket wait a generous ceiling (e2e_live_update.rs uses 5 s for the same frame).
Rename the test to drop "within one second" and fix the comment, which talks about a 1 s budget the code does not check.
A real latency check belongs in a release-build benchmark, not here.
While there, api_save.rs has four 1 s timeouts on an in-process broadcast channel; widening them is free.

Pointers

  • src/simlin-serve/tests/integration/e2e_mcp_browser.rs: mcp_edit_propagates_to_browser_within_one_second
  • src/simlin-serve/tests/integration/api_save.rs

Activity

  1. added
    ci
    bug
    on Oct 12, 2026
  2. changed the title [-]test: e2e_mcp_browser asserts a 2s wall-clock propagation budget on a debug build under pre-commit load (flaky)[/-] [+]test: MCP-to-browser propagation test fails on timing under load[/+] on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugci

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions