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

オープン 初心者向け
#78 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@mamoun123121314 がすでに取り組んでいます。

2026年11月28日 から。

  • #84 @mamoun123121314 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
electron, typescript
領域
testing

調査の方向性

まず tests/portCheck.test.ts を確認し、「sees a udp port that is bound」テストと、ポートの取得方法を調べてください。TCP のアサーションを削除するか、提案されている再試行ループを使って、両方のプロトコルを同じポートにバインドしてください。ポートチェックのテストを実行し、別の TCP ソケットが選択されたポートを使用する可能性がある状況でも、安定して成功することを確認してください。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
3
フォーク
0
平均マージ
2分
マージ済み PR(30日)
35

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

A21-devs/Virtual-Machine-Manager のほかの issue

A21-devs/Virtual-Machine-Manager の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。