bug(e2e): macOS script stdin EOF detaches lifecycle test sessions
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- kubernetes, rust
- 領域
- devtools, testing-qa
調査の方向性
まず sandbox_lifecycle の E2E テストから始め、macOS script を CLI 経由で呼び出す名前の挙がった4つのテストを見つけます。それらのテストがコマンド出力をどのように収集するかを読み、Issue にある再現コマンドを使って macOS 上で該当するテストを実行します。出力の収集中は script の stdin パイプを開いたままにします。ストリーミング出力が取得され、7 と 17 を含む期待される終了コードが、繰り返し実行しても保持されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
User Story
I have been investigating OpenShell's E2E tests on Kubernetes. I encountered intermittent failures when running the sandbox lifecycle suite from macOS. This prevents macOS from being a trustworthy platform for validating OpenShell lifecycle behaviour.
Problem Statement
Four sandbox_lifecycle E2E tests fail intermittently or consistently when run from macOS:
canonical_main_nonzero_exit_preserves_statuscanonical_main_exit_zero_completes_persistent_sandboxsandbox_create_with_no_keep_preserves_failure_then_cleans_upsandbox_create_with_no_keep_cleans_up_after_tty_command
The tests launch the CLI through macOS script to provide a TTY. When the test runner's stdin reaches EOF, macOS script can write the terminal's VEOF value — Ctrl-D, byte 0x04 — to the PTY. Ctrl-D detach is intentional for an interactive canonical-main attachment (#3744), but here it is injected by the harness rather than typed by a user. The supervisor interprets the byte as a detach request. The tests then observe missing streamed output and an exit status of 0 instead of the command's actual status (7 or 17 in the failing tests).
Impact / Why This Matters
These are false test failures: the sandbox command can succeed or fail with its real status, while the test sees a detached session with no output and status 0. This blocks macOS validation, forces reruns, and can hide real output-forwarding or exit-status regressions. Rerunning is not a reliable workaround because the behavior is timing-dependent.
On 2026-11-17, this reproduced on upstream main 0be63c5b0de27692df03ba0e4b3bc212312d3b3c, with matching upstream source, CLI, chart and published images on macOS + OpenShift. All four unmodified tests failed. Holding the script stdin pipe open until output collection completed made all four pass against the same revision and images.
Earlier macOS + kind runs also failed without the guard and passed with it, using digest-pinned upstream images.
Acceptance Criteria
- The four affected lifecycle tests pass consistently when run repeatedly from macOS.
- Each test captures the command's expected streamed output.
- Commands with nonzero exit statuses preserve their expected exit codes (
7and17in the affected tests). - The test harness keeps script stdin open until the command completes and output collection finishes.
Reproduction Steps
- On macOS, check out upstream OpenShell at
0be63c5b0de27692df03ba0e4b3bc212312d3b3c. For OpenShift, apply the wrapper fixes from eviehoward/OpenShell#10. Leave the lifecycle tests unchanged for the initial run. - Build the CLI:
cargo build -p openshell-cli - With an existing cluster context, run the four affected tests using matching upstream images:
export OPENSHELL_E2E_KUBE_CONTEXT="$(kubectl config current-context)" export OPENSHELL_BIN="$PWD/target/debug/openshell" export OPENSHELL_E2E_KUBE_BUILD_IMAGES=0 export OPENSHELL_REGISTRY=ghcr.io/nvidia/openshell export IMAGE_TAG=0be63c5b0de27692df03ba0e4b3bc212312d3b3c e2e/with-kube-gateway.sh cargo nextest run \ --manifest-path e2e/rust/Cargo.toml --target-dir e2e/rust/target \ --features e2e-kubernetes --test sandbox_lifecycle \ --config-file .config/nextest.toml --profile e2e-kubernetes \ --no-tests fail --test-threads 1 \ -E 'test(=canonical_main_exit_zero_completes_persistent_sandbox) | test(=canonical_main_nonzero_exit_preserves_status) | test(=sandbox_create_with_no_keep_cleans_up_after_tty_command) | test(=sandbox_create_with_no_keep_preserves_failure_then_cleans_up)' - Observe missing streamed output in the zero-exit tests and status
0instead of7or17in the nonzero-exit tests. The recorded unmodified run failed all four tests in 134.003 seconds. - In each of the four affected tests, replace
cmd.output()with a spawned child whose piped stdin handle stays alive untilwait_with_output()completes:cmd.stdin(Stdio::piped()); let mut child = cmd.spawn().expect("spawn openshell sandbox create"); let _stdin_guard = child.stdin.take().expect("retain script stdin"); let output = child.wait_with_output().await.expect("wait for sandbox create"); - Repeat the same command. The recorded guarded run passed all four tests in 167.815 seconds.
Suggested UX (if applicable)
No response
Environment
- OpenShell: upstream main
0be63c5b0de27692df03ba0e4b3bc212312d3b3c; CLI built from that revision. - OS: macOS, Darwin
27.2.0, ARM64, using/usr/bin/script. - Deployment: upstream Kubernetes E2E harness on OpenShift, two AMD64 nodes running Kubernetes
v1.35.9; agent-sandboxv1.0.3. - Images:
ghcr.io/nvidia/openshell/{gateway,supervisor,sandbox}:0be63c5b0de27692df03ba0e4b3bc212312d3b3c. - Resolved registry digests with Linux AMD64 selection: gateway
sha256:c3788be7a214115001741b385170734169bcda9ad410420efde33d1742177fad; supervisorsha256:4b3fab6470e9fb7012d931e0b52fc0fbb101fbab27759c83790930feead448b0; sandboxsha256:c46b4539845b589ca0b7717f3baee57003c796ab65e4817b79f74f6d849f156c.
Logs
Current-upstream results (2026-11-17):
Original tests: Summary [134.003s] 4 tests run: 0 passed, 4 failed, 5 skipped
Stdin guard: Summary [167.815s] 4 tests run: 4 passed, 5 skipped
Minimal failure output:
thread 'canonical_main_nonzero_exit_preserves_status' panicked:
assertion `left == right` failed: unexpected result
left: Some(0)
right: Some(7)
...
thread 'sandbox_create_with_no_keep_cleans_up_after_tty_command' panicked:
main output was not streamed
...
thread 'sandbox_create_with_no_keep_preserves_failure_then_cleans_up' panicked:
ephemeral main should preserve its failure code
left: Some(0)
right: Some(17)
Historical diagnostic supervisor logging captured the explicit detach decision (not recaptured in the current-main run):
detach=true ctrl_d=true input_bytes=1 input_error=false
- 主要言語
- Rust
- スター
- 21.5k
- フォーク
- 2.1k
- 平均マージ
- 2日 20時間
- マージ済み PR(30日)
- 246
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/OpenShell のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
bug: Ready=False/PodTerminating is treated as a terminal sandbox failure対応中かも @TaylorMutch が 1 日前に担当しました。 オープンstate:accepted state:pr-opened
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA/OpenShell#5588 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
state:triage-needed
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
state:triage-needed
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
NVIDIA/OpenShell の issue をすべて見る
似ている issue
-
ai_p2
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
ClickHouse/ClickHouse#132519 ·
メンテナーはふだん 1 日以内に返信
-
Pattern-clip compiler tests miss the clip cap, sort order, muted output and count/emit agreementオープンarea: engine type: test
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
YuriiMurha/grooviq#224 ·
メンテナーはふだん 1 日以内に返信
-
state:needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
zed-industries/zed#67109 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
storytold/photocraft#15500 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue language priority/low
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
ZanattaMichael/meridian-core#143 ·
メンテナーはふだん 1 日以内に返信