fallow icon indicating copy to clipboard operation
fallow copied to clipboard

Flaky test: sidecar api-surface test gets "context canceled" on stderr

Open BartWaardenburg opened this issue 1 month ago • 2 comments

Problem

The sidecar test api-surface reads type arguments only from type references and keeps stderr clean (tools/type-aware-sidecar/test/sidecar.test.mjs) fails at random in CI. The assertion assert.equal(result.stderr, "") gets "context canceled\n".

It failed three times on 2026-11-06 in the JS Lint and Format job:

  • on main at e572f3ab0: https://github.com/fallow-rs/fallow/actions/runs/42227224609
  • on two pull requests that did not change the sidecar. A rerun of the failed job passed both times.

Expected

The test passes on each run, or it fails only for a real defect.

Notes

  • context canceled looks like the text that the TypeScript native backend writes when a request context ends before its work is done. The sidecar then exits 0, but stderr is not empty.
  • Two possible fixes: make the sidecar end its backend session without a canceled context, or let the test accept this one known line. The first fix also keeps stderr clean for users.

BartWaardenburg avatar Nov 06 '26 17:11 BartWaardenburg

Taking this — going for the first option (end the backend session without a canceled context, keeping stderr clean for users too), with the test-side acceptance only as a fallback if the session lifecycle turns out to be owned by the backend.

rezamuliawijaya avatar Nov 07 '26 12:11 rezamuliawijaya

We fixed the stderr shutdown message in #5737, and it is out in v3.53.0 (npm install [email protected]).

The sidecar now stops the TypeScript backend by closing stdin without sending SIGTERM. If the backend does not exit within 5 seconds, the sidecar sends SIGKILL. The api-surface test checks for empty stderr again.

@rezamuliawijaya, thanks for volunteering earlier. Since a few weeks passed without a pull request, we went ahead and landed the fix.

BartWaardenburg avatar Dec 03 '26 10:12 BartWaardenburg