[ddc] do not fail during cleanup of expression_compiler tests.

Currently our end-2-end tests create a temporary folder and delete
it after the suite has completed. Only one folder is created for the
entire test run, so the deletion only gets scheduled when the entire
suite has completed.

On windows bots, the cleanup very often fails causing up to 40%
flakiness on some tests.

This CL keeps the cleanup logic as is, but will now deem tests as
passing even when we can't do the proper cleanup.

Change-Id: I8e2e2d39d1bbdaf48c138c0a05a9a2540345fc28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359760
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
Sigmund Cherem 2024-03-26 00:58:58 +00:00 committed by Commit Queue
parent b3aa031eb4
commit 34b7df107f

View file

@ -308,8 +308,9 @@ class ExpressionEvaluationTestDriver {
deleteAttempts++;
try {
await chromeDir.delete(recursive: true);
} on FileSystemException {
if (deleteAttempts > 3) rethrow;
} on FileSystemException catch (e) {
print('Error trying to delete chromeDir: $e');
if (deleteAttempts > 3) return;
var delayMs = pow(10, deleteAttempts).floor();
await Future.delayed(Duration(milliseconds: delayMs));
}