File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818
1919set timeout 30
2020
21- # Disable output buffering
22- log_user 1
21+ # Reopen stdin from /dev/zero to prevent EOF from /dev/null
22+ # This fixes "bad file number" errors when expect_before detects stdin EOF
23+ close stdin
24+ open /dev/zero r
2325
2426# Test environment paths
2527set repo_dir [pwd]
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ set test_dir "/tmp/merge-overlay-test-[clock seconds]"
77set repo_dir "$test_dir/repo"
88set overlay_upper "$test_dir/overlay"
99
10+ # Reopen stdin from /dev/zero to prevent EOF from /dev/null
11+ # This fixes "bad file number" errors when expect_before detects stdin EOF
12+ close stdin
13+ open /dev/zero r
14+
1015# Global timeout handler - record failure but continue testing
1116expect_before {
1217 timeout {
@@ -144,6 +149,10 @@ proc test_accept_new_file {} {
144149 log_failure "Timeout waiting for file prompt"
145150 }
146151 }
152+
153+ # Ensure spawn is fully cleaned up
154+ catch { close }
155+ catch { wait }
147156}
148157
149158# Test 2: Discard a new file (r)
You can’t perform that action at this time.
0 commit comments