시험: remote_idle_test 흔들림 고침을 rc_next f43f067 에서 가져옴 (slow() 0.1초 간격 · 3초 제한, SFTP 준비 단계 10초 - 15, 코드 변경 없음)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>next10
parent
56c632d372
commit
65098287e8
|
|
@ -154,15 +154,15 @@ void main() {
|
||||||
expect(t, lessThan(const Duration(seconds: 5)));
|
expect(t, lessThan(const Duration(seconds: 5)));
|
||||||
expect(cut, isTrue);
|
expect(cut, isTrue);
|
||||||
await c.close();
|
await c.close();
|
||||||
// 0.4초마다 조각 (정한 1초 안) - 끝까지
|
// 0.1초마다 조각 (정한 3초 안 - 전체 시험의 부하에서도 넉넉하게, 0b 지적 10/20: 0.4초 대 1초는 한 번 넘음) - 끝까지
|
||||||
Stream<List<int>> slow() async* {
|
Stream<List<int>> slow() async* {
|
||||||
for (var i = 0; i < 5; i++) {
|
for (var i = 0; i < 5; i++) {
|
||||||
await Future<void>.delayed(const Duration(milliseconds: 400));
|
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||||
yield [i];
|
yield [i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(await idleRead(slow()).length, 5);
|
expect(await idleRead(slow(), limit: const Duration(seconds: 3)).length, 5);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('도우미: 올리기 - 보내는 쪽이 더 가져가지 않으면 · 다 가져간 뒤 답이 없으면 실패', () async {
|
test('도우미: 올리기 - 보내는 쪽이 더 가져가지 않으면 · 다 가져간 뒤 답이 없으면 실패', () async {
|
||||||
|
|
@ -297,8 +297,11 @@ void main() {
|
||||||
test('받는 중에 서버가 멈추면 · 명령 (열기) 에 답이 없으면 정한 시간 뒤 실패', () async {
|
test('받는 중에 서버가 멈추면 · 명령 (열기) 에 답이 없으면 정한 시간 뒤 실패', () async {
|
||||||
final c = client();
|
final c = client();
|
||||||
addTearDown(c.close);
|
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'));
|
expect((await c.list('/')).map((e) => e.rel), contains('/a.bin'));
|
||||||
final s = await c.openReadFrom('a.bin'); // 열기까지는 됨
|
final s = await c.openReadFrom('a.bin'); // 열기까지는 됨
|
||||||
|
RemoteIdle.limit = const Duration(seconds: 1); // 받기 (listen) 때 이 시간으로
|
||||||
proxy!.stall = true; // 이제 서버가 아무것도 보내지 않음
|
proxy!.stall = true; // 이제 서버가 아무것도 보내지 않음
|
||||||
final (t, e) = await _timed(() => s.drain<void>());
|
final (t, e) = await _timed(() => s.drain<void>());
|
||||||
expect(e, isA<RemoteIdleTimeout>(), reason: '$e');
|
expect(e, isA<RemoteIdleTimeout>(), reason: '$e');
|
||||||
|
|
@ -306,7 +309,9 @@ void main() {
|
||||||
final c2 = client();
|
final c2 = client();
|
||||||
addTearDown(c2.close);
|
addTearDown(c2.close);
|
||||||
proxy!.stall = false;
|
proxy!.stall = false;
|
||||||
|
RemoteIdle.limit = const Duration(seconds: 10);
|
||||||
await c2.list('/');
|
await c2.list('/');
|
||||||
|
RemoteIdle.limit = const Duration(seconds: 1);
|
||||||
proxy!.stall = true;
|
proxy!.stall = true;
|
||||||
final (t2, e2) = await _timed(() => c2.openReadFrom('a.bin'));
|
final (t2, e2) = await _timed(() => c2.openReadFrom('a.bin'));
|
||||||
expect(e2, isA<RemoteIdleTimeout>(), reason: '$e2');
|
expect(e2, isA<RemoteIdleTimeout>(), reason: '$e2');
|
||||||
|
|
@ -316,7 +321,9 @@ void main() {
|
||||||
test('올리는 중에 서버가 멈추면 정한 시간 뒤 실패', () async {
|
test('올리는 중에 서버가 멈추면 정한 시간 뒤 실패', () async {
|
||||||
final c = client();
|
final c = client();
|
||||||
addTearDown(c.close);
|
addTearDown(c.close);
|
||||||
|
RemoteIdle.limit = const Duration(seconds: 10); // 준비는 넉넉하게 (위와 같음)
|
||||||
await c.list('/');
|
await c.list('/');
|
||||||
|
RemoteIdle.limit = const Duration(seconds: 1);
|
||||||
proxy!.stall = true;
|
proxy!.stall = true;
|
||||||
final (t, e) = await _timed(() => c.write('b.bin', _big()));
|
final (t, e) = await _timed(() => c.write('b.bin', _big()));
|
||||||
expect(e, isA<RemoteIdleTimeout>(), reason: '$e');
|
expect(e, isA<RemoteIdleTimeout>(), reason: '$e');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue