diff --git a/test/dns_proxy_test.dart b/test/dns_proxy_test.dart index f8881ff..3fc9bcd 100644 --- a/test/dns_proxy_test.dart +++ b/test/dns_proxy_test.dart @@ -54,7 +54,8 @@ void main() { final t = FakeDns({'big.test': '10.9.9.9'}, truncateUdp: true); await t.start(); addTearDown(t.close); - final r = DnsResolver(config: () => custom('127.0.0.1'), port: t.port); + // 흔들림: UDP (잘림) → TCP 다시 묻기가 두 번 왕복이라, 전체 시험이 무거울 때 처음 값 2.5초를 넘길 수 있다 - 넉넉히 + final r = DnsResolver(config: () => custom('127.0.0.1'), port: t.port, timeout: const Duration(seconds: 10)); // 전체 실행에서만 실패한 적이 있다 - 실패하면 실제 오류와 가짜 DNS 의 기록을 남긴다 try { expect((await r.lookup('big.test')).single.address, '10.9.9.9'); diff --git a/test/explorer_test.dart b/test/explorer_test.dart index 1873988..a602af3 100644 --- a/test/explorer_test.dart +++ b/test/explorer_test.dart @@ -735,11 +735,11 @@ Finder chevronOf(String name) => find.descendant( /// 두 번 누르기 (실제 비동기 구역에서: 그때 시작한 파일 작업이 테스트의 가짜 시간에 묶이지 않게) Future doubleTap(WidgetTester tester, Finder f) async { - await tester.runAsync(() async { - await tester.tap(f); - await Future.delayed(const Duration(milliseconds: 80)); - await tester.tap(f); - }); + // 흔들림: 두 누름 사이를 실제 시간 (80ms) 으로 쉬면 무거울 때 두 번 누르기 판정 (300ms) 을 넘겨 한 번씩 두 번으로 됐다 - + // 시험의 가짜 시간으로 50ms. 그 뒤 시작한 파일 작업은 settle (실제 시간) 이 기다린다 + await tester.tap(f); + await tester.pump(const Duration(milliseconds: 50)); + await tester.tap(f); await tester.pump(); } diff --git a/test/sync_problem_test.dart b/test/sync_problem_test.dart index 6cee69e..c24373b 100644 --- a/test/sync_problem_test.dart +++ b/test/sync_problem_test.dart @@ -14,7 +14,7 @@ import 'package:jj_mkvmaker/ui/explorer_page.dart'; import 'package:jj_mkvmaker/ui/monitor_page.dart'; import 'package:path/path.dart' as p; -import 'explorer_test.dart' show act, settle; +import 'explorer_test.dart' show act, calm, settle; /// 68 · 70 · 71 void main() { @@ -186,10 +186,11 @@ void main() { tester.view.devicePixelRatio = 1; addTearDown(tester.view.reset); await tester.runAsync(() => tester.pumpWidget(MaterialApp(home: ExplorerPage(c: c)))); - await settle(tester, () => find.text('doc.txt').evaluate().isNotEmpty); + // 흔들림: 만들다 만 파일 수는 목록을 읽은 뒤 따로 센다 - 무거울 때는 doc.txt 보다 늦게 나온다 + await settle(tester, () => find.text('doc.txt').evaluate().isNotEmpty && find.text('만들다 만 파일 1개').evaluate().isNotEmpty); expect(find.text('만들다 만 파일 1개'), findsWidgets); await act(tester, () => tester.tap(find.text('지우기').first)); - await tester.pumpAndSettle(); + await calm(tester); expect(find.text('만들다 만 파일 1개를 지울까요?'), findsOneWidget); expect(find.text('movie.mkv.jjpart'), findsWidgets); await act(tester, () => tester.tap(find.widgetWithText(FilledButton, '지우기')));