Index: test/test_pub.dart |
diff --git a/test/test_pub.dart b/test/test_pub.dart |
index 03889c67ffd1c2f36ae8ea272edd62c13f1cdce0..f0de1b7d9eb41ac960545f29574a95cc27745e2b 100644 |
--- a/test/test_pub.dart |
+++ b/test/test_pub.dart |
@@ -363,8 +363,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(); |