From 4b4d911734c0fec04112244add0ee9e82c174ccd Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sat, 23 May 2026 09:48:26 +0200 Subject: [PATCH] harden PTY test timeouts (5s -> 20s) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The real-shell PTY tests gave a child + reader-isolate only 5s to deliver first output; under transient scheduling latency that was occasionally exceeded, flaking the pre-push gate (retry:2 usually but not always absorbed it). A working PTY echoes in well under a second, so 20s is pure headroom — a genuinely dead PTY still fails, just later. Verified 5/5 clean runs after the bump. Co-Authored-By: Claude Opus 4.7 (1M context) --- test/pty/session_test.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/pty/session_test.dart b/test/pty/session_test.dart index 80994a36..5e74371a 100644 --- a/test/pty/session_test.dart +++ b/test/pty/session_test.dart @@ -38,7 +38,7 @@ void main() { ); addTearDown(s.close); - final got = await _readUntil(s, 'hello-pty', const Duration(seconds: 5)); + final got = await _readUntil(s, 'hello-pty', const Duration(seconds: 20)); expect(got, contains('hello-pty')); }); @@ -67,13 +67,13 @@ void main() { addTearDown(sub.cancel); await firstByte.future.timeout( - const Duration(seconds: 5), - onTimeout: () => fail('shell never produced its first byte within 5s'), + const Duration(seconds: 20), + onTimeout: () => fail('shell never produced its first byte within 20s'), ); s.write(utf8.encode('echo write-test-ok\n')); - final result = await _waitForBuffer(buf, 'write-test-ok', const Duration(seconds: 5)); + final result = await _waitForBuffer(buf, 'write-test-ok', const Duration(seconds: 20)); expect(result, contains('write-test-ok')); }); @@ -95,8 +95,8 @@ void main() { await s.close(); await done.future.timeout( - const Duration(seconds: 3), - onTimeout: () => fail('output stream did not close within 3s after s.close()'), + const Duration(seconds: 10), + onTimeout: () => fail('output stream did not close within 10s after s.close()'), ); expect(s.isClosed, isTrue); }); @@ -116,7 +116,7 @@ void main() { ); addTearDown(s.close); - final got = await _readUntil(s, 'path-resolution-ok', const Duration(seconds: 5)); + final got = await _readUntil(s, 'path-resolution-ok', const Duration(seconds: 20)); expect(got, contains('path-resolution-ok')); });