시험 흔들림: 여러 개 표시 시험은 목록 다시 읽기가 끝난 뒤 새 폴더 · 이름 변경

- 무거운 전체 실행에서 pumpAndSettle 이 창들의 다시 읽기 진행 막대 때문에 시간 초과 - idle() 로 실제 시간 기다림 (시험만, 관리자 승인)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix_mkv
RyuJongJin 2026-10-11 23:40:11 +09:00
parent 8c2ddc3385
commit d991ef91c1
1 changed files with 8 additions and 1 deletions

View File

@ -561,13 +561,15 @@ void main() {
await settle(tester, () => find.text('doc.txt').evaluate().isEmpty);
expect(Directory(left).listSync(), isEmpty);
// 새 폴더 → 이름 변경
// 새 폴더 → 이름 변경 (지운 뒤 창들이 목록을 다시 읽는 동안은 진행 막대가 돌아 pumpAndSettle 이 끝나지 않는다 - 무거울 때 흔들림)
await idle(tester);
await act(tester, () => tester.tap(find.text('새 폴더').first));
await tester.pumpAndSettle();
await act(tester, () => tester.enterText(find.byType(TextField), 'films'));
await act(tester, () => tester.tap(find.widgetWithText(FilledButton, '확인')));
await settle(tester, () => find.text('films').evaluate().isNotEmpty);
expect(Directory(p.join(left, 'films')).existsSync(), isTrue);
await idle(tester);
await act(tester, () => tester.tap(find.text('이름 변경').first));
await tester.pumpAndSettle();
await act(tester, () => tester.enterText(find.byType(TextField), 'movies'));
@ -741,6 +743,11 @@ Future<void> doubleTap(WidgetTester tester, Finder f) async {
await tester.pump();
}
/// 창들이 목록을 다시 읽는 중 (맨 위 진행 막대) 이 끝날 때까지 실제 시간으로 기다린다.
/// 그사이 pumpAndSettle 을 하면 막대가 계속 움직여, 디스크 읽기가 늦을 때 (전체 시험이 무거울 때) 시간 초과가 난다
Future<void> idle(WidgetTester tester) =>
settle(tester, () => find.byType(LinearProgressIndicator).evaluate().isEmpty && find.byType(CircularProgressIndicator).evaluate().isEmpty);
/// 실제 파일 작업 (비동기 IO) 이 끝나기를 기다리며 화면을 갱신
// 끝나면 바로 나온다 - 넉넉한 횟수는 전체 시험 중 PC 가 바쁠 때 (실제 파일 입출력이 느려짐) 흔들리지 않게
Future<void> settle(WidgetTester tester, bool Function() done, {int rounds = 300}) async {