🤖 tests: backgroundProcessesRepro reads exit_code before the trap writes it (CI flake)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- shell, typescript
- Ambito
- testing
Direzione di ricerca
Inizia dall'helper spawnExited in src/node/services/backgroundProcessesRepro.test.ts, intorno alla riga 107, dove attende il file con il codice di uscita e poi lo legge una sola volta. Il trap EXIT che scrive il marcatore si trova in src/node/runtime/backgroundCommands.ts, vicino alla riga 83. Controlla anche i blocchi simili di attesa e lettura vicino alle righe 386 e 478 dello stesso file di test. È completato quando l'helper si risolve solo dopo che il file contiene un numero e il test supera ripetutamente sotto carico.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
backgroundProcessesRepro.test.ts failed once in CI and passed on the rerun. The failing test is "terminating a background process that already exited > a stop after a natural exit sends no signal to the process group" (2013 ms).
- Run: https://github.com/coder/xum/actions/runs/38532297270 (attempt 1, job "Test / Unit (1/6)", PR #6475). Attempt 2 passed.
expectReproFailurereported "repro failed elsewhere". The real error came from the setup helperspawnExited, not from the target assertion:
at spawnExited (src/node/services/backgroundProcessesRepro.test.ts:108:63)
expect(received).toBe(expected)
Expected: "3"
Received: ""
Cause (from reading the code, not reproduced yet)
- The wrapper's EXIT trap writes the marker with
echo $? > "$__MUX_EXIT_CODE_PATH"(src/node/runtime/backgroundCommands.ts:83). The shell creates the file first and writes the digits after that. For a short time the file exists and is empty. spawnExitedwaits only until the file exists (backgroundProcessesRepro.test.ts:107), then reads it once (line 108). A read in that gap returns "".- The product reader already treats an empty marker as "no exit code yet" (
getExitCodeStrict,src/node/services/backgroundProcessExecutor.ts:654-659). So I think only the test helper is wrong. I did not verify every other reader.
This is not the same cause as #6443 (that one is slow happy-dom matcher output inside waitFor).
Possible fix
Make the helper wait until the file holds a number (for example waitFor(async () => /^\d+$/.test((await fs.readFile(f, "utf-8").catch(() => "")).trim()))), and check other tests that use the same "exists, then read" shape on exit_code (lines 386 and 478 of the same file wait on files too).
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $1.26
- Lingua principale
- TypeScript
- Stelle
- 2.1k
- Fork
- 142
- Merge medio
- 5h 26m
- PR unite (30g)
- 903
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di coder/xum
-
🤖 fix: two command-palette titles and old Windows rows still use a backslash-blind project nameForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
tech-debt
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
approved backlog
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
area:plugins enhancement platform:vscode
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
anthropics/claude-code#103166 ·
I maintainer di solito rispondono entro 1 giorno
-
Add: Add pogo tv indiaApertacheck:failed streams:add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
iptv-org/iptv#55744 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
jitsi/jitsi-meet#18021 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
spec: discovery input example can contain multiple aliases for one parameter, with no canonical oneAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
x402-foundation/x402#3841 ·
I maintainer di solito rispondono entro 1 giorno