File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -548,7 +548,7 @@ class TestContext {
548548 _client? .close ();
549549 await _outputDir? .delete (recursive: true );
550550 stopLogWriter ();
551- project.tearDown ();
551+ await project.tearDown ();
552552
553553 // clear the state for next setup
554554 _webDriver = null ;
Original file line number Diff line number Diff line change @@ -252,9 +252,16 @@ class TestProject {
252252 }
253253
254254 /// Delete the project if we made a copy.
255- void tearDown () {
255+ Future < void > tearDown () async {
256256 if (editable) {
257- _fixturesCopy.deleteSync (recursive: true );
257+ try {
258+ _fixturesCopy.deleteSync (recursive: true );
259+ } on FileSystemException catch (_) {
260+ // On Windows, the build daemon process might still be accessing the
261+ // working directory, so wait a second and then try again.
262+ await Future .delayed (const Duration (seconds: 1 ));
263+ _fixturesCopy.deleteSync (recursive: true );
264+ }
258265 }
259266 }
260267
You can’t perform that action at this time.
0 commit comments