From dacb1fbc11ea235b7ca7da4bbaaa3c5a5b9de9f3 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 25 Aug 2017 09:47:51 -0700 Subject: [PATCH] Increase RCTTestRunner timeouts Reviewed By: shergin Differential Revision: D5706622 fbshipit-source-id: 2185e673913d366afca234d121eaf601ff7c5887 --- Libraries/RCTTest/RCTTestRunner.h | 2 +- Libraries/RCTTest/RCTTestRunner.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/RCTTest/RCTTestRunner.h b/Libraries/RCTTest/RCTTestRunner.h index e2def90b2aa..c59f73d73ca 100644 --- a/Libraries/RCTTest/RCTTestRunner.h +++ b/Libraries/RCTTest/RCTTestRunner.h @@ -17,7 +17,7 @@ #define RCT_RUN_RUNLOOP_WHILE(CONDITION) \ { \ - NSDate *timeout = [NSDate dateWithTimeIntervalSinceNow:5]; \ + NSDate *timeout = [NSDate dateWithTimeIntervalSinceNow:30]; \ NSRunLoop *runloop = [NSRunLoop mainRunLoop]; \ while ((CONDITION)) { \ [runloop runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.01]]; \ diff --git a/Libraries/RCTTest/RCTTestRunner.m b/Libraries/RCTTest/RCTTestRunner.m index e2fe4d8bca2..dd381c0dabb 100644 --- a/Libraries/RCTTest/RCTTestRunner.m +++ b/Libraries/RCTTest/RCTTestRunner.m @@ -152,7 +152,7 @@ expectErrorBlock:(BOOL(^)(NSString *error))expectErrorBlock RCTAssert(nonLayoutSubviews.count == 0, @"There shouldn't be any other views: %@", nonLayoutSubviews); #endif - + if (expectErrorBlock) { RCTAssert(expectErrorBlock(error), @"Expected an error but nothing matched."); } else { @@ -165,7 +165,7 @@ expectErrorBlock:(BOOL(^)(NSString *error))expectErrorBlock } // Wait for bridge to disappear before continuing to the next test - NSDate *invalidateTimeout = [NSDate dateWithTimeIntervalSinceNow:5]; + 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]];