[CFE] Fix 'Found failures!' message not being last in weekly test
We delay the execution of the second leak test ("leak test alternative
invalidation") to ensure the first one has fetched pub packages and
avoid both of them trying to do the same thing at the same time, or one
thinking it has been done when it's not actually done yet etc). If this
is slow or there's a crash it waits for at most 10 minutes before
launching the second iteration.
In those 10 minutes, though, it can have started waiting for all other
tests to finish and once they have, if any failed, print the
"Found failures!" (and what has failed of those) mixed in with all the
output from the leak test.
Technically, if the other tests finished within the 10 minutes (they
won't) it might even make it look like there are no failures even if the
second leak tests fails.
This CL fixes the issue by first awaiting the start of the second leak
test before awaiting the finishing of all started processes.
Change-Id: Iaace924346aa2bb4b8c6e025bd53e95e6a414a34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266021
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/front_end/test/weekly_tester.dart b/pkg/front_end/test/weekly_tester.dart
index 5f52e98..a44e914 100644
--- a/pkg/front_end/test/weekly_tester.dart
+++ b/pkg/front_end/test/weekly_tester.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE.md file.
-import 'dart:async' show Future;
+import 'dart:async' show Completer, Future;
import 'dart:convert' show LineSplitter, utf8;
import 'dart:io' show File, Platform, Process, exitCode;
@@ -18,6 +18,7 @@
"\n\n");
List<WrappedProcess> startedProcesses = [];
+ Completer<void> startedDelayedProcess = new Completer<void>();
WrappedProcess? leakTest;
{
// Very slow: Leak-test.
@@ -71,6 +72,7 @@
],
"leak test alternative invalidation",
));
+ startedDelayedProcess.complete();
}();
}
}
@@ -143,6 +145,7 @@
}
// Wait for everything to finish.
+ await startedDelayedProcess.future;
List<int> exitCodes =
await Future.wait(startedProcesses.map((e) => e.process.exitCode));
if (exitCodes.where((e) => e != 0).isNotEmpty) {