Use (processors-1) for test runs (test defaults to processors/2) (#22803)

* Use (processors-1) for test runs (test defaults to processors/2)

* Add missing import 🙄
This commit is contained in:
Danny Tuppeny 2018-10-19 08:07:54 +01:00 committed by GitHub
parent be0dde4114
commit b357b55904
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@
import 'dart:async';
import 'dart:io';
import 'dart:math' as math;
import 'package:path/path.dart' as path;
@ -223,6 +224,8 @@ Future<void> _pubRunTest(
bool enableFlutterToolAsserts = false
}) {
final List<String> args = <String>['run', 'test', '-rcompact'];
final int concurrency = math.max(1, Platform.numberOfProcessors - 1);
args.add('-j$concurrency');
if (!hasColor)
args.add('--no-color');
if (testPath != null)