Flaky test: portCheck assumes the TCP side of a random UDP port is free

Aperta Adatta ai principianti
#78 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@mamoun123121314 ci sta già lavorando.

Dal 28/11/2026.

  • #84 di @mamoun123121314 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
electron, typescript
Ambito
testing

Direzione di ricerca

Inizia da tests/portCheck.test.ts ed esamina il test «sees a udp port that is bound» e il modo in cui ottiene una porta. Rimuovi l’asserzione TCP oppure usa il ciclo di nuovi tentativi suggerito per associare entrambi i protocolli alla stessa porta. Esegui i test di verifica delle porte e conferma che passano in modo affidabile quando un altro socket TCP potrebbe usare la porta selezionata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug tests

tests/portCheck.test.ts > "sees a udp port that is bound" failed twice today on my machine, then passed on rerun.

The test binds UDP on port 0 (any free port), then checks isPortFree(port, 'tcp') is true because "tcp and udp ports are separate". That's true for our socket, but the OS only promised the UDP port was free. Something else on the PC can have that same number bound on TCP (Windows hands out ephemeral ports from the same range for both), and then the assertion fails.

Fix idea: drop the TCP assertion from this test, or pick the port by first binding TCP and UDP on the same number in a short retry loop so the test owns both sides.

Lingua principale
TypeScript
Stelle
3
Fork
0
Merge medio
2m
PR unite (30g)
35

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di A21-devs/Virtual-Machine-Manager

Tutte le issue di A21-devs/Virtual-Machine-Manager

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.