diff --git a/test/remote_idle_test.dart b/test/remote_idle_test.dart index 2413193..b82a876 100644 --- a/test/remote_idle_test.dart +++ b/test/remote_idle_test.dart @@ -154,15 +154,15 @@ void main() { expect(t, lessThan(const Duration(seconds: 5))); expect(cut, isTrue); await c.close(); - // 0.4초마다 조각 (정한 1초 안) - 끝까지 + // 0.1초마다 조각 (정한 3초 안 - 전체 시험의 부하에서도 넉넉하게, 0b 지적 10/20: 0.4초 대 1초는 한 번 넘음) - 끝까지 Stream> slow() async* { for (var i = 0; i < 5; i++) { - await Future.delayed(const Duration(milliseconds: 400)); + await Future.delayed(const Duration(milliseconds: 100)); yield [i]; } } - expect(await idleRead(slow()).length, 5); + expect(await idleRead(slow(), limit: const Duration(seconds: 3)).length, 5); }); test('도우미: 올리기 - 보내는 쪽이 더 가져가지 않으면 · 다 가져간 뒤 답이 없으면 실패', () async { @@ -297,8 +297,11 @@ void main() { test('받는 중에 서버가 멈추면 · 명령 (열기) 에 답이 없으면 정한 시간 뒤 실패', () async { final c = client(); addTearDown(c.close); + // 준비 (연결 · 목록 · 열기) 는 넉넉하게 - 함께 도는 시험의 부하에서 paramiko 의 답이 1초를 넘은 적이 있다 (15 검증 10/20) + RemoteIdle.limit = const Duration(seconds: 10); expect((await c.list('/')).map((e) => e.rel), contains('/a.bin')); final s = await c.openReadFrom('a.bin'); // 열기까지는 됨 + RemoteIdle.limit = const Duration(seconds: 1); // 받기 (listen) 때 이 시간으로 proxy!.stall = true; // 이제 서버가 아무것도 보내지 않음 final (t, e) = await _timed(() => s.drain()); expect(e, isA(), reason: '$e'); @@ -306,7 +309,9 @@ void main() { final c2 = client(); addTearDown(c2.close); proxy!.stall = false; + RemoteIdle.limit = const Duration(seconds: 10); await c2.list('/'); + RemoteIdle.limit = const Duration(seconds: 1); proxy!.stall = true; final (t2, e2) = await _timed(() => c2.openReadFrom('a.bin')); expect(e2, isA(), reason: '$e2'); @@ -316,7 +321,9 @@ void main() { test('올리는 중에 서버가 멈추면 정한 시간 뒤 실패', () async { final c = client(); addTearDown(c.close); + RemoteIdle.limit = const Duration(seconds: 10); // 준비는 넉넉하게 (위와 같음) await c.list('/'); + RemoteIdle.limit = const Duration(seconds: 1); proxy!.stall = true; final (t, e) = await _timed(() => c.write('b.bin', _big())); expect(e, isA(), reason: '$e');