Repository navigation
Commit b29862d
committed
fix(cli): eliminate flaky subprocess integration tests
Remove vm_slow_progress_before_ready from the subprocess-based
structured output tests. The 1.8s artificial delay (3x 600ms sleeps)
left only ~0.7s headroom within the 5s OPENSHELL_PROVISION_TIMEOUT,
causing sporadic TLS handshake failures on loaded Linux machines.
Root cause analysis:
- The CertificateRequired TLS alert occurs when the provision timeout
fires mid-handshake, causing the client to drop the connection before
presenting its certificate.
- tokio::process::Command is NOT the cause: it is a thin async wrapper
around std::process::Command that delegates environment setup, process
spawning, and I/O identically. The only behavioral difference (forcing
stdout/stderr pipes in .output()) is correct for these tests.
- The single-threaded tokio runtime is NOT the cause: testing with
multi_thread flavor produces identical timing (~2.5s with
slow_progress vs ~0.7s without).
- TempDir lifetime is sound: the directory lives until .output().await
returns, so certs exist for the subprocess's entire lifetime.
- Cert path resolution is deterministic: the subprocess resolves
XDG_CONFIG_HOME/openshell/gateways/openshell/mtls/ correctly.
The subprocess tests exist to verify that the real CLI binary produces
clean stdout (no ANSI chrome, spinners, or progress text leaking into
structured output). This invariant does not depend on slow progress
events; the ProgressOutput::Silent branch that swallows progress events
is already covered by the in-process test
sandbox_create_keeps_waiting_while_vm_progress_arrives.
Without the artificial delay, tests complete in ~0.7s with 4.3s of
timeout headroom, eliminating the timing-dependent failure window.
Fixes #2501
Assisted-By: 🤖 Claude Code
Signed-off-by: Roland Huß <[email protected]>1 parent deced87 commit b29862d
1 file changed
Lines changed: 4 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1944 | 1944 | | |
1945 | 1945 | | |
1946 | 1946 | | |
1947 | | - | |
| 1947 | + | |
1948 | 1948 | | |
1949 | | - | |
1950 | | - | |
1951 | | - | |
1952 | | - | |
1953 | | - | |
1954 | 1949 | | |
1955 | | - | |
| 1950 | + | |
1956 | 1951 | | |
1957 | 1952 | | |
1958 | 1953 | | |
| |||
1964 | 1959 | | |
1965 | 1960 | | |
1966 | 1961 | | |
1967 | | - | |
| 1962 | + | |
1968 | 1963 | | |
1969 | | - | |
1970 | | - | |
1971 | | - | |
1972 | | - | |
1973 | | - | |
1974 | 1964 | | |
1975 | | - | |
| 1965 | + | |
1976 | 1966 | | |
1977 | 1967 | | |
1978 | 1968 | | |
| |||
0 commit comments