Skip to content

Commit 557d309

Browse files
committed
chore(build): improve reliability of the saucelabs job
Closes angular#3848
1 parent 4ba4427 commit 557d309

File tree

6 files changed

+52
-51
lines changed

6 files changed

+52
-51
lines changed

modules/angular2/test/core/zone/ng_zone_spec.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ function commonTests() {
208208
macroTask(() => {
209209
expect(_log.result()).toEqual('run; onTurnDone; onEventDone');
210210
async.done();
211-
}, 80);
212-
}));
211+
}, 150);
212+
}), 200);
213213

214214
it('should run async tasks scheduled inside onEventDone outside Angular zone',
215215
inject([AsyncTestCompleter], (async) => {
@@ -230,7 +230,7 @@ function commonTests() {
230230
TimerWrapper.setTimeout(() => {
231231
expect(_log.result()).toEqual('run; onTurnDone; onEventDone; asyncTask');
232232
async.done();
233-
}, 10);
233+
}, 20);
234234
});
235235
}));
236236

@@ -402,8 +402,8 @@ function commonTests() {
402402
// Second VM Turn => microtask enqueued from onTurnDone
403403
'onTurnStart; executedMicrotask; onTurnDone(begin); onTurnDone(end)');
404404
async.done();
405-
}, 80);
406-
}));
405+
}, 150);
406+
}), 200);
407407

408408
it('should call onTurnStart and onTurnDone for a scheduleMicrotask in onTurnDone triggered by ' +
409409
'a scheduleMicrotask in run',
@@ -437,8 +437,8 @@ function commonTests() {
437437
// Second VM Turn => the microtask enqueued from onTurnDone
438438
'onTurnStart; onTurnDone(executeMicrotask); onTurnDone(begin); onTurnDone(end)');
439439
async.done();
440-
}, 80);
441-
}));
440+
}, 150);
441+
}), 200);
442442

443443
it('should execute promises scheduled in onTurnStart before promises scheduled in run',
444444
inject([AsyncTestCompleter], (async) => {
@@ -492,8 +492,8 @@ function commonTests() {
492492
// Second VM turn: execute the microtask from onTurnEnd
493493
'onTurnStart(begin); onTurnStart(end); onTurnDone(executePromise); onTurnDone(begin); onTurnDone(end)');
494494
async.done();
495-
}, 80);
496-
}));
495+
}, 150);
496+
}), 200);
497497

498498
it('should call onTurnStart and onTurnDone before and after each turn, respectively',
499499
inject([AsyncTestCompleter], (async) => {
@@ -513,7 +513,7 @@ function commonTests() {
513513
macroTask(() => { _zone.run(() => { completerA.resolve(null); }); }, 20);
514514

515515

516-
macroTask(() => { _zone.run(() => { completerB.resolve(null); }); }, 100);
516+
macroTask(() => { _zone.run(() => { completerB.resolve(null); }); }, 120);
517517

518518
macroTask(() => {
519519
expect(_log.result())
@@ -545,8 +545,8 @@ function commonTests() {
545545
expect(_log.result())
546546
.toEqual('onTurnStart; run start; run end; async1; async2; onTurnDone');
547547
async.done();
548-
}, 80);
549-
}));
548+
}, 150);
549+
}), 200);
550550

551551
it('should call onTurnStart and onTurnDone for promises created outside of run body',
552552
inject([AsyncTestCompleter], (async) => {
@@ -567,8 +567,8 @@ function commonTests() {
567567
expect(_log.result())
568568
.toEqual('onTurnStart; zone run; onTurnDone; onTurnStart; promise then; onTurnDone');
569569
async.done();
570-
}, 80);
571-
}));
570+
}, 150);
571+
}), 200);
572572
});
573573

574574
describe('exceptions', () => {

modules/angular2/test/router/integration/lifecycle_hook_spec.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function main() {
100100
expect(log).toEqual(['activate: null -> /on-activate']);
101101
async.done();
102102
});
103-
}));
103+
}), 2000);
104104

105105
it('should wait for a parent component\'s onActivate hook to resolve before calling its child\'s',
106106
inject([AsyncTestCompleter], (async) => {
@@ -123,7 +123,7 @@ export function main() {
123123
async.done();
124124
});
125125
});
126-
}));
126+
}), 2000);
127127

128128
it('should call the onDeactivate hook', inject([AsyncTestCompleter], (async) => {
129129
compile()
@@ -136,7 +136,7 @@ export function main() {
136136
expect(log).toEqual(['deactivate: /on-deactivate -> /a']);
137137
async.done();
138138
});
139-
}));
139+
}), 2000);
140140

141141
it('should wait for a child component\'s onDeactivate hook to resolve before calling its parent\'s',
142142
inject([AsyncTestCompleter], (async) => {
@@ -161,7 +161,7 @@ export function main() {
161161
async.done();
162162
});
163163
});
164-
}));
164+
}), 2000);
165165

166166
it('should reuse a component when the canReuse hook returns true',
167167
inject([AsyncTestCompleter], (async) => {
@@ -182,7 +182,7 @@ export function main() {
182182
expect(cmpInstanceCount).toBe(1);
183183
async.done();
184184
});
185-
}));
185+
}), 2000);
186186

187187

188188
it('should not reuse a component when the canReuse hook returns false',
@@ -204,7 +204,7 @@ export function main() {
204204
expect(cmpInstanceCount).toBe(2);
205205
async.done();
206206
});
207-
}));
207+
}), 2000);
208208

209209

210210
it('should navigate when canActivate returns true', inject([AsyncTestCompleter], (async) => {
@@ -224,7 +224,7 @@ export function main() {
224224
async.done();
225225
});
226226
});
227-
}));
227+
}), 2000);
228228

229229
it('should not navigate when canActivate returns false',
230230
inject([AsyncTestCompleter], (async) => {
@@ -244,7 +244,7 @@ export function main() {
244244
async.done();
245245
});
246246
});
247-
}));
247+
}), 2000);
248248

249249
it('should navigate away when canDeactivate returns true',
250250
inject([AsyncTestCompleter], (async) => {
@@ -269,7 +269,7 @@ export function main() {
269269
async.done();
270270
});
271271
});
272-
}));
272+
}), 2000);
273273

274274
it('should not navigate away when canDeactivate returns false',
275275
inject([AsyncTestCompleter], (async) => {
@@ -294,7 +294,7 @@ export function main() {
294294
async.done();
295295
});
296296
});
297-
}));
297+
}), 2000);
298298

299299

300300
it('should run activation and deactivation hooks in the correct order',
@@ -322,7 +322,7 @@ export function main() {
322322
]);
323323
async.done();
324324
});
325-
}));
325+
}), 2000);
326326

327327
it('should only run reuse hooks when reusing', inject([AsyncTestCompleter], (async) => {
328328
compile()
@@ -349,7 +349,7 @@ export function main() {
349349
]);
350350
async.done();
351351
});
352-
}));
352+
}), 2000);
353353

354354
it('should not run reuse hooks when not reusing', inject([AsyncTestCompleter], (async) => {
355355
compile()
@@ -378,7 +378,7 @@ export function main() {
378378
]);
379379
async.done();
380380
});
381-
}));
381+
}), 2000);
382382
});
383383
}
384384

modules/angular2/test/router/integration/router_integration_spec.ts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function main() {
6262
async.done();
6363
});
6464
});
65-
}));
65+
}), 1000);
6666
});
6767

6868
describe('broken app', () => {
@@ -78,7 +78,7 @@ export function main() {
7878
async.done();
7979
});
8080
});
81-
}));
81+
}), 1000);
8282
});
8383

8484
describe('back button app', () => {
@@ -148,26 +148,27 @@ export function main() {
148148
});
149149
router.navigate('/parent/child');
150150
});
151-
}));
151+
}), 1000);
152152

153153
describe('custom app base ref', () => {
154154
beforeEachBindings(() => { return [bind(APP_BASE_HREF).toValue('/my/app')]; });
155-
it('should bootstrap', inject([AsyncTestCompleter, TestComponentBuilder],
156-
(async, tcb: TestComponentBuilder) => {
157-
158-
tcb.createAsync(HierarchyAppCmp)
159-
.then((rootTC) => {
160-
var router = rootTC.componentInstance.router;
161-
router.subscribe((_) => {
162-
expect(rootTC.nativeElement)
163-
.toHaveText('root { parent { hello } }');
164-
expect(rootTC.componentInstance.location.path())
165-
.toEqual('/my/app/parent/child');
166-
async.done();
167-
});
168-
router.navigate('/parent/child');
169-
});
170-
}));
155+
it('should bootstrap',
156+
inject([AsyncTestCompleter, TestComponentBuilder],
157+
(async, tcb: TestComponentBuilder) => {
158+
159+
tcb.createAsync(HierarchyAppCmp)
160+
.then((rootTC) => {
161+
var router = rootTC.componentInstance.router;
162+
router.subscribe((_) => {
163+
expect(rootTC.nativeElement).toHaveText('root { parent { hello } }');
164+
expect(rootTC.componentInstance.location.path())
165+
.toEqual('/my/app/parent/child');
166+
async.done();
167+
});
168+
router.navigate('/parent/child');
169+
});
170+
}),
171+
1000);
171172
});
172173
});
173174
// TODO: add a test in which the child component has bindings
@@ -192,7 +193,7 @@ export function main() {
192193
router.navigate('/qs?q=search-for-something');
193194
rootTC.detectChanges();
194195
});
195-
}));
196+
}), 1000);
196197
});
197198
});
198199
}

modules/angular2/test/router/integration/router_link_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export function main() {
179179
async.done();
180180
});
181181
});
182-
}));
182+
}), 1000);
183183

184184
it('should navigate to link hrefs in presence of base href',
185185
inject([AsyncTestCompleter], (async) => {
@@ -200,7 +200,7 @@ export function main() {
200200
async.done();
201201
});
202202
});
203-
}));
203+
}), 1000);
204204
});
205205
});
206206
}

modules/angular2/test/router/location_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function main() {
6363
expect(ev['url']).toEqual('/user/btford');
6464
async.done();
6565
})
66-
}), 1000);
66+
}), 2000);
6767

6868
it('should normalize location path', () => {
6969
locationStrategy.internalPath = '/my/app/user/btford';

modules/angular2/test/web_workers/shared/message_bus_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function main() {
3535
});
3636
var toEmitter = bus.to(CHANNEL);
3737
ObservableWrapper.callNext(toEmitter, MESSAGE);
38-
}));
38+
}), 1000);
3939

4040
it("should broadcast", inject([AsyncTestCompleter], (async) => {
4141
const CHANNEL = "CHANNEL 1";

0 commit comments

Comments
 (0)