diff --git a/Libraries/RCTTest/RCTTestRunner.m b/Libraries/RCTTest/RCTTestRunner.m index 2004e6a01bb96b..cb865302087975 100644 --- a/Libraries/RCTTest/RCTTestRunner.m +++ b/Libraries/RCTTest/RCTTestRunner.m @@ -186,13 +186,12 @@ - (void)runTest:(SEL)test module:(NSString *)moduleName [bridge invalidate]; } - // Wait for bridge to disappear before continuing to the next test + // Give the bridge a chance to disappear before continuing to the next test. NSDate *invalidateTimeout = [NSDate dateWithTimeIntervalSinceNow:30]; while (invalidateTimeout.timeIntervalSinceNow > 0 && batchedBridge != nil) { [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; } - RCTAssert(batchedBridge == nil, @"Bridge should be deallocated after the test"); } @end