test(daemon): cover echo acknowledgement through sequenced input
The echo ack test called the tracker directly, so removing noteInputApplied from handleSequencedInput left the suite green. It now drives handleSequencedInput.
- commit
- 8dda6f55153419777eee191180e169568e34f182
- author
- brice · · 2026-10-08 06:01 UTC
- parent
- 8442b74
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +5 -3
M internal/usecase/daemon/echo_ack_test.go +5 -3
| @@ -65,11 +65,13 @@ func (c *echoTestClock) nextTimer(t *testing.T) (*manualAttentionTimer, time.Dur | |||
| 65 | 65 | ||
| 66 | 66 | func TestEchoAckWaitsForEchoTimeoutAndSendsAckOnlyOutput(t *testing.T) { | |
| 67 | 67 | clock := newEchoTestClock() | |
| 68 | - | d, _, ac, sends := newManualSessionWithPTYsClock(t, clock, newQuietPTY()) | |
| 68 | + | d, sess, ac, sends := newManualSessionWithPTYsClock(t, clock, newQuietPTY()) | |
| 69 | 69 | ||
| 70 | - | d.noteInputApplied(ac, 1) | |
| 70 | + | // Drive the production input path so the acknowledgement wiring is | |
| 71 | + | // covered, not just the tracker. | |
| 72 | + | d.handleSequencedInput(sess, ac, 1, []byte("a")) | |
| 71 | 73 | clock.advance(20 * time.Millisecond) | |
| 72 | - | d.noteInputApplied(ac, 2) | |
| 74 | + | d.handleSequencedInput(sess, ac, 2, []byte("b")) | |
| 73 | 75 | timer, delay := clock.nextTimer(t) | |
| 74 | 76 | require.Equal(t, echoAckDelay, delay) | |
| 75 | 77 | require.Zero(t, ac.echoAck.Load(), "input is not echoed when applied") | |
| @@ -65,11 +65,13 @@ func (c *echoTestClock) nextTimer(t *testing.T) (*manualAttentionTimer, time.Dur | |||||
| 65 | 65 | ||||
| 66 | func TestEchoAckWaitsForEchoTimeoutAndSendsAckOnlyOutput(t *testing.T) { | 66 | func TestEchoAckWaitsForEchoTimeoutAndSendsAckOnlyOutput(t *testing.T) { | ||
| 67 | clock := newEchoTestClock() | 67 | clock := newEchoTestClock() | ||
| 68 | - | d, _, ac, sends := newManualSessionWithPTYsClock(t, clock, newQuietPTY()) | 68 | + | d, sess, ac, sends := newManualSessionWithPTYsClock(t, clock, newQuietPTY()) |
| 69 | 69 | ||||
| 70 | - | d.noteInputApplied(ac, 1) | 70 | + | // Drive the production input path so the acknowledgement wiring is |
| 71 | + | // covered, not just the tracker. | |||
| 72 | + | d.handleSequencedInput(sess, ac, 1, []byte("a")) | |||
| 71 | clock.advance(20 * time.Millisecond) | 73 | clock.advance(20 * time.Millisecond) | ||
| 72 | - | d.noteInputApplied(ac, 2) | 74 | + | d.handleSequencedInput(sess, ac, 2, []byte("b")) |
| 73 | timer, delay := clock.nextTimer(t) | 75 | timer, delay := clock.nextTimer(t) | ||
| 74 | require.Equal(t, echoAckDelay, delay) | 76 | require.Equal(t, echoAckDelay, delay) | ||
| 75 | require.Zero(t, ac.echoAck.Load(), "input is not echoed when applied") | 77 | require.Zero(t, ac.echoAck.Load(), "input is not echoed when applied") | ||