From 9bed9d7f95f74e8a5e5e97e873eca917bdd59789 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Thu, 9 Jan 2025 18:41:05 -0800 Subject: [PATCH] Replace the always omitted `CPU` environment variable with `numberOfProcessors`. (#161392) I am not sure if this is a 1:1 comparison, so please advise. Towards https://github.com/flutter/flutter/issues/161387. --- dev/bots/utils.dart | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/dev/bots/utils.dart b/dev/bots/utils.dart index c14e015829..4f573ccfe1 100644 --- a/dev/bots/utils.dart +++ b/dev/bots/utils.dart @@ -426,20 +426,10 @@ Future runDartTest( List? tags, bool runSkipped = false, }) async { - int? cpus; - final String? cpuVariable = Platform.environment['CPU']; // CPU is set in cirrus.yml - if (cpuVariable != null) { - cpus = int.tryParse(cpuVariable, radix: 10); - if (cpus == null) { - foundError([ - '${red}The CPU environment variable, if set, must be set to the integer number of available cores.$reset', - 'Actual value: "$cpuVariable"', - ]); - return; - } - } else { - cpus = 2; // Don't default to 1, otherwise we won't catch race conditions. - } + // TODO(matanlurey): Consider Platform.numberOfProcessors instead. + // See https://github.com/flutter/flutter/issues/161399. + int cpus = 2; + // Integration tests that depend on external processes like chrome // can get stuck if there are multiple instances running at once. if (forceSingleCore) {