88// tslint:disable:no-console
99// tslint:disable:no-implicit-dependencies
1010import { logging } from '@angular-devkit/core' ;
11- import { spawnSync } from 'child_process' ;
11+ import { execSync , spawnSync } from 'child_process' ;
1212import * as glob from 'glob' ;
1313import 'jasmine' ;
1414import { SpecReporter as JasmineSpecReporter } from 'jasmine-spec-reporter' ;
@@ -23,8 +23,6 @@ const knownFlakes = [
2323 // Rebuild tests in test-large are flakey if not run as the first suite.
2424 // https://github.com/angular/angular-cli/pull/15204
2525 'packages/angular_devkit/build_angular/test/browser/rebuild_spec_large.ts' ,
26- // This is flaky with NGCC
27- 'packages/angular_devkit/build_angular/test/karma/selected_spec_large.ts' ,
2826] ;
2927
3028const projectBaseDir = join ( __dirname , '..' ) ;
@@ -94,6 +92,10 @@ export default function(args: ParsedArgs, logger: logging.Logger) {
9492 if ( args [ 've' ] ) {
9593 // tslint:disable-next-line:no-console
9694 console . warn ( '********* VE Enabled ***********' ) ;
95+ } else if ( args . shard !== undefined ) {
96+ // CI is really flaky with NGCC
97+ // This is a working around test order and isolation issues.
98+ execSync ( './node_modules/.bin/ivy-ngcc' , { stdio : 'inherit' } ) ;
9799 }
98100
99101 if ( args . large ) {
0 commit comments