Flaky test: tunnel enabled_tunnel_starts_at_boot fails port_open on Linux CI

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

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

まだ誰も着手していません。

評価

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

調査の方向性

まず crates/atlas-cli/tests/tunnel.rs の240行目あたりから、fixture enabled_tunnel_starts_at_boot_with_expected_ssh_args_and_stops_on_exit を調べ、次に supervisor.rs の spawn_and_wait と ensure_up を読んでください。失敗する assertion に tunnel.log と f.invocations() を含め、次の失敗時にポートの衝突とそれ以外の原因を区別できるようにしてください。ログで衝突が確認できた場合は、並行テストが使用できないポートを fixture に割り当ててください。並列 Linux CI でテストが安定して成功すれば完了です。

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

説明

area: ci os: linux type: bug

atlas-cli::tunnel enabled_tunnel_starts_at_boot_with_expected_ssh_args_and_stops_on_exit failed today on Rust (Linux) in three unrelated PR runs, both attempts each time (nextest retry), always at the same line:

panicked at crates/atlas-cli/tests/tunnel.rs:240:5:
assertion failed: port_open(f.local_port)

Runs: 43915049469 (fix/release-notes-github-limit), 43894385419 (perf/virtualize-large-lists), 43887797630 (feat/yank-list). None of them touch the tunnel code; the full CI of 20b14c8b (main) passed.

What is known:

  • The test waits until the status file says the tunnel is running, then checks the port once (200 ms connect).
  • The supervisor only reports Running after its own port check succeeds (supervisor.rs spawn_and_wait / ensure_up), so the product does not claim a port it has not seen open.
  • ensure_up also reports Running without starting ssh when the port is already accepting connections ("already accepting connections; not starting ssh").
  • common::free_port() binds 127.0.0.1:0, drops the listener and returns the port, and nextest runs ~4000 tests in parallel processes.

Hypothesis (not proven): another test's listener briefly held the same port when atlas started, atlas adopted it as "already open" and never ran the fake ssh, then that listener went away before the assertion. If so, f.invocations() is empty in the failing runs, and .logs/tunnel.log holds the "already accepting connections" line.

To close: make the failing assertion print tunnel.log and f.invocations(), which tells the two cases apart on the next failure; if it is the collision, give each fixture a port that no other test can take (hold a listener until the fake ssh is about to bind, or pick from a range outside the ephemeral one).

主要言語
Rust
スター
3
フォーク
1
平均マージ
9時間 51分
マージ済み PR(30日)
310

環境構築

はじめの一歩

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

codeatlasdev/atlas のほかの issue

codeatlasdev/atlas の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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