Skip to content

Commit 9ddb344

Browse files
committed
testsuite: ensure eof is the last output event with pty.capture
Problem: The shell pty tests do not test that eof is the last event in the output eventlog when using pty.capture. Enhance the test in t2612-job-shell-pty.t that runs with pty.interactive and pty.catpure to run multiple times and ensure that the eof is the final output eventlog event in all cases.
1 parent cd575b8 commit 9ddb344

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

t/t2612-job-shell-pty.t

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,17 @@ test_expect_success 'pty: pty.interactive forces a pty on rank 0' '
108108
flux job eventlog -p guest.output ${id} | grep "adding pty to rank 0"
109109
'
110110
test_expect_success 'pty: -o pty.interactive and -o pty.capture can be used together' '
111-
id=$(flux submit -o pty.interactive -o pty.capture tty) &&
112-
$runpty flux job attach $id >ptyim.out 2>&1 &&
113-
$runpty flux job attach $id
111+
for i in $(seq 1 3); do
112+
id=$(flux submit -o pty.interactive -o pty.capture tty) &&
113+
$runpty flux job attach $id >ptyim.out 2>&1 &&
114+
$runpty flux job attach $id &&
115+
flux job eventlog -f json -p guest.output $id \
116+
| tail -n1 >last-event.$i
117+
done &&
118+
# Check that eof:true is the last event for all runs
119+
cat last-event.1 | jq -e .context.eof &&
120+
cat last-event.2 | jq -e .context.eof &&
121+
cat last-event.3 | jq -e .context.eof
114122
'
115123
test_expect_success 'pty: unsupported -o pty.<opt> generates exception' '
116124
test_must_fail flux run -o pty.foo hostname

0 commit comments

Comments
 (0)