From 62e8d520316cf360add662d7897c424d16a56361 Mon Sep 17 00:00:00 2001 From: RyuJongJin <266630912+RyuJongJin@users.noreply.github.com> Date: Mon, 12 Oct 2026 08:04:06 +0900 Subject: [PATCH] =?UTF-8?q?WIP=20=EC=8B=9C=ED=97=98=20=ED=9D=94=EB=93=A4?= =?UTF-8?q?=EB=A6=BC:=20sync=5Fproblem=2071=20(=EB=A7=8C=EB=93=A4=EB=8B=A4?= =?UTF-8?q?=20=EB=A7=8C=20=ED=8C=8C=EC=9D=BC=20=EC=88=98=EA=B0=80=20?= =?UTF-8?q?=EB=8A=A6=EA=B2=8C)=20=C2=B7=20dns=20TC=20(=EB=91=90=20?= =?UTF-8?q?=EB=B2=88=20=EC=99=95=EB=B3=B5=20=EC=8B=9C=EA=B0=84)=20=C2=B7?= =?UTF-8?q?=20=EB=91=90=20=EB=B2=88=20=EB=88=84=EB=A5=B4=EA=B8=B0=20(?= =?UTF-8?q?=EA=B0=80=EC=A7=9C=20=EC=8B=9C=EA=B0=84=20=EA=B0=84=EA=B2=A9)?= =?UTF-8?q?=20(=EA=B2=80=ED=86=A0=20=EB=8C=80=EA=B8=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- test/dns_proxy_test.dart | 3 ++- test/explorer_test.dart | 10 +++++----- test/sync_problem_test.dart | 7 ++++--- 3 files changed, 11 insertions(+), 9 deletions(-) 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 6f3f4a1..ff90cc4 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() { @@ -225,10 +225,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, '지우기')));