explorer_test: tearDown 의 임시 폴더 지우기를 될 때까지 기다리기

Windows 에서 방금 닫은 파일 (65 의 잠금 시험) 이나 색인 · 백신이 잠깐 잡고 있으면 지우기가 실패할 수 있다.
100ms 씩 최대 약 5초 다시 지운다. (65 만 20번 연달아 돌려 모두 통과 - 실패는 재현되지 않음)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
묶음4
RyuJongJin 2026-10-10 00:13:35 +09:00
parent 4c0bc0b9ce
commit 6010aa908b
1 changed files with 12 additions and 1 deletions

View File

@ -44,7 +44,18 @@ void main() {
mediaTool: ProcessMediaTool('x', 'y'), storage: DesktopStorageService(), shell: shell));
c.settings.explorerPaths = [left, right];
});
tearDown(() => tmp.deleteSync(recursive: true));
// Windows: 방금 닫은 파일 (65 의 잠금 시험) 이나 색인 · 백신이 잠깐 잡고 있으면 지우기가 실패한다 - 될 때까지 기다린다
tearDown(() async {
for (var i = 0;; i++) {
try {
if (tmp.existsSync()) tmp.deleteSync(recursive: true);
return;
} on FileSystemException {
if (i >= 50) rethrow;
await Future<void>.delayed(const Duration(milliseconds: 100));
}
}
});
Future<void> open(WidgetTester tester) async {
tester.view.physicalSize = const Size(1600, 900);