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.
diff --git a/dev/bots/utils.dart b/dev/bots/utils.dart
index c14e015..4f573cc 100644
--- a/dev/bots/utils.dart
+++ b/dev/bots/utils.dart
@@ -426,20 +426,10 @@
List<String>? 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(<String>[
- '${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) {