@@ -346,11 +346,12 @@ - (void)testReportFailureOnTimeoutCrashAndPass {
346
346
}
347
347
348
348
/* *
349
- Execution plan: CRASH, TIMEOUT, PASS
349
+ Execution plan: CRASH
350
350
*/
351
- - (void )testReportFailureOnCrashTimeoutAndPass {
351
+ - (void )testNoRetryOnCrash {
352
352
self.config .stuckTimeout = @6 ;
353
- self.config .testing_ExecutionPlan = @" CRASH TIMEOUT PASS" ;
353
+ self.config .testing_ExecutionPlan = @" CRASH" ; // No retry
354
+ self.config .errorRetriesCount = @4 ;
354
355
self.config .onlyRetryFailed = TRUE ;
355
356
NSString *testBundlePath = [BPTestHelper sampleAppHangingTestsBundlePath ];
356
357
self.config .testBundlePath = testBundlePath;
@@ -364,6 +365,49 @@ - (void)testReportFailureOnCrashTimeoutAndPass {
364
365
XCTAssertTrue (exitCode == BPExitStatusAppCrashed);
365
366
}
366
367
368
+
369
+ /* *
370
+ Execution plan: One test CRASHes and another one TIMEs OUT and PASSes on retry
371
+ */
372
+ - (void )testReportFailureOnCrashAndTimeoutTests {
373
+ self.config .stuckTimeout = @6 ;
374
+ self.config .testing_ExecutionPlan = @" CRASH; SKIP TIMEOUT PASS" ;
375
+ self.config .onlyRetryFailed = TRUE ;
376
+ self.config .failureTolerance = @1 ;
377
+ self.config .errorRetriesCount = @2 ;
378
+ NSString *testBundlePath = [BPTestHelper sampleAppHangingTestsBundlePath ];
379
+ self.config .testBundlePath = testBundlePath;
380
+ NSString *tempDir = NSTemporaryDirectory ();
381
+ NSError *error;
382
+ NSString *outputDir = [BPUtils mkdtemp: [NSString stringWithFormat: @" %@ /AppHangingTestsSetTempDir" , tempDir] withError: &error];
383
+ NSLog (@" output directory is %@ " , outputDir);
384
+ self.config .outputDirectory = outputDir;
385
+
386
+ BPExitStatus exitCode = [[[Bluepill alloc ] initWithConfiguration: self .config] run ];
387
+ XCTAssertTrue (exitCode == BPExitStatusAppCrashed);
388
+ }
389
+
390
+ /* *
391
+ Execution plan: One test CRASHes and another one keeps timing out
392
+ */
393
+ - (void )testReportBothCrashAndTimeout {
394
+ self.config .stuckTimeout = @6 ;
395
+ self.config .testing_ExecutionPlan = @" CRASH; SKIP TIMEOUT TIMEOUT" ;
396
+ self.config .onlyRetryFailed = TRUE ;
397
+ self.config .failureTolerance = @1 ;
398
+ self.config .errorRetriesCount = @2 ;
399
+ NSString *testBundlePath = [BPTestHelper sampleAppHangingTestsBundlePath ];
400
+ self.config .testBundlePath = testBundlePath;
401
+ NSString *tempDir = NSTemporaryDirectory ();
402
+ NSError *error;
403
+ NSString *outputDir = [BPUtils mkdtemp: [NSString stringWithFormat: @" %@ /AppHangingTestsSetTempDir" , tempDir] withError: &error];
404
+ NSLog (@" output directory is %@ " , outputDir);
405
+ self.config .outputDirectory = outputDir;
406
+
407
+ BPExitStatus exitCode = [[[Bluepill alloc ] initWithConfiguration: self .config] run ];
408
+ XCTAssertTrue (exitCode == (BPExitStatusAppCrashed | BPExitStatusTestTimeout));
409
+ }
410
+
367
411
/* *
368
412
Execution plan: FAIL, TIMEOUT, PASS
369
413
*/
0 commit comments