Fix TUI attach fallback test stack overflow - #19597
Conversation
|
Thanks for jumping on this! I tested the same class of fix locally and wanted to share one extra data point from Windows. The per-test large-stack wrapper fixes the originally reported attach fallback tests, but on my machine
A broader approach that worked locally was setting fn main() {
if std::env::var_os("CARGO_CFG_WINDOWS").is_some() {
// Match the CLI runtime's worker stack so debug-heavy app tests do
// not overflow Windows libtest threads before assertions run.
println!("cargo:rustc-env=RUST_MIN_STACK=16777216");
}
}Local verification:
I don't want to derail this PR if the narrower wrapper is preferred, but if the intent is to unblock local Windows Thanks again for responding and getting back so quickly, I've been ramping up my codex cli usage on Windows and love to give back to such a great tool! Thanks for making it open source! |
|
OK, then this problem is more involved. I'm going to abandon this approach. This will need to take a back seat since it's not affecting our CI or other users. |
|
Thanks for looking into this! I'll let you know from my end if my local fix was enough |
Why
Fixes #19596.
The
codex-tuifallback tests forattach_live_thread_for_selectionexercise the embedded app-server path, which can exceed the default test-thread stack in debug builds. When that happens, the process aborts with a stack overflow before the tests can report a normal assertion result. The issue was reported on Windows, and the same failure reproduced locally without increasingRUST_MIN_STACK.What changed
The two affected fallback tests now run through a small test helper that creates an explicit 4 MiB thread stack and drives the async test body with a current-thread Tokio runtime. The test behavior is unchanged: both cases still assert that empty or unmaterialized fallback threads are rejected without creating a local thread event channel.
Verification
cargo test -p codex-tui attach_live_thread_for_selection_rejects_ -- --test-threads=1cargo test -p codex-tuino longer aborts with the reported stack overflow; it progressed past these tests and later failed on unrelated sandbox-sensitive status snapshot/config expectations.