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.
This commit is contained in:
parent
4efb64b53a
commit
9bed9d7f95
@ -426,20 +426,10 @@ Future<void> runDartTest(
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user