Index: test/test_pub.dart |
diff --git a/test/test_pub.dart b/test/test_pub.dart |
index 05429792254d48b46503840b0c16a3b2e4be2d1a..8dcebc7940d8251bd0dab66d071ee4936da139d5 100644 |
--- a/test/test_pub.dart |
+++ b/test/test_pub.dart |
@@ -381,8 +381,16 @@ void _integration(String description, void body(), [Function testFn]) { |
testFn(description, () { |
_sandboxDir = createSystemTempDir(); |
d.defaultRoot = sandboxDir; |
- currentSchedule.onComplete.schedule(() => deleteEntry(_sandboxDir), |
- 'deleting the sandbox directory'); |
+ currentSchedule.onComplete.schedule(() { |
+ try { |
+ deleteEntry(_sandboxDir); |
+ } on ApplicationException catch (_) { |
+ // Silently swallow exceptions on Windows. If the test failed, there may |
+ // still be lingering processes that have files in the sandbox open, |
+ // which will cause this to fail on Windows. |
+ if (!Platform.isWindows) rethrow; |
+ } |
+ }, 'deleting the sandbox directory'); |
// Schedule the test. |
body(); |