시험 흔들림: settings_group_bar_test (412 묶음 바로가기) - 화면이 멈출 때까지 기다리고 치운 뒤에도 남은 일을 끝냄 (검토 대기)

관리자 지시 (10/20): 67개 시험 파일을 한꺼번에 돌릴 때 한 번 실패 (혼자서 · 무거운 시험과 함께 · 67개 다시 663개 모두 재현되지 않음). 실패 줄에 Expected · Timeout 이 없어 값이 틀린 것이 아니라 시험 밖으로 넘어간 예외로 봄: 설정 화면의 칸들이 시작한 진짜 입출력 (레지스트리 조회 · 구성 요소 목록 HttpClient · 파일) 이 부하가 크면 한 번 그린 뒤 · 화면을 치운 뒤에야 끝남. 이제 재기 전과 치운 뒤에 화면이 멈출 때까지 (위젯 수가 세 번 같음) 진짜 시간을 흘리고, 그만큼 시험 시간을 2분으로. 코드 변경 없음.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gb_flaky
RyuJongJin 2026-10-20 15:39:20 +09:00
parent 7f2263bbb9
commit 60b994a9e6
1 changed files with 16 additions and 2 deletions

View File

@ -23,7 +23,20 @@ void main() {
addTearDown(tester.view.reset); addTearDown(tester.view.reset);
final c = AppController(PlatformServices(mediaTool: ProcessMediaTool('x', 'y'), storage: DesktopStorageService())); final c = AppController(PlatformServices(mediaTool: ProcessMediaTool('x', 'y'), storage: DesktopStorageService()));
await tester.runAsync(() => tester.pumpWidget(MaterialApp(home: SettingsPage(c: c)))); await tester.runAsync(() => tester.pumpWidget(MaterialApp(home: SettingsPage(c: c))));
// 관리자 지시 (10/20, 15): 부하가 크면 (여러 시험을 함께 돌림) 칸들이 시작한 진짜 입출력 (레지스트리 조회 · 구성 요소 목록 ·
// 파일) 이 늦게 끝나 화면이 바뀌거나, 화면을 치운 뒤에야 끝나 예외가 났다 - 화면이 멈출 때까지 (위젯 수가 세 번 같음) 진짜 시간을 흘린다
Future<void> settle() async {
var last = -1, same = 0;
for (var i = 0; i < 150 && same < 3; i++) {
await tester.runAsync(() => Future<void>.delayed(const Duration(milliseconds: 20)));
await tester.pump(); await tester.pump();
final n = find.byType(Widget).evaluate().length;
same = n == last ? same + 1 : 0;
last = n;
}
}
await settle();
final tops = {for (final e in find.byType(ActionChip).evaluate()) tester.getRect(find.byWidget(e.widget)).top.round()}; final tops = {for (final e in find.byType(ActionChip).evaluate()) tester.getRect(find.byWidget(e.widget)).top.round()};
expect(tops, isNotEmpty); expect(tops, isNotEmpty);
if (oneRow) { if (oneRow) {
@ -31,7 +44,8 @@ void main() {
} }
expect(tester.takeException(), isNull); expect(tester.takeException(), isNull);
await tester.pumpWidget(const SizedBox()); await tester.pumpWidget(const SizedBox());
await settle(); // 치운 뒤에도 남은 비동기 일이 이 시험 안에서 끝나게
await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1));
}); }, timeout: const Timeout(Duration(minutes: 2))); // 화면이 멈출 때까지 기다리므로 부하가 크면 30초를 넘을 수 있음
} }
} }