Skip to content

Commit

Permalink
Increase RCTTestRunner timeouts
Browse files Browse the repository at this point in the history
Reviewed By: shergin

Differential Revision: D5706622

fbshipit-source-id: 2185e673913d366afca234d121eaf601ff7c5887
  • Loading branch information
javache authored and facebook-github-bot committed Aug 25, 2017
1 parent b050b69 commit dacb1fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Libraries/RCTTest/RCTTestRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -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]]; \
Expand Down
4 changes: 2 additions & 2 deletions Libraries/RCTTest/RCTTestRunner.m
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ - (void)runTest:(SEL)test module:(NSString *)moduleName

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 {
Expand All @@ -165,7 +165,7 @@ - (void)runTest:(SEL)test module:(NSString *)moduleName
}

// 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]];
Expand Down

0 comments on commit dacb1fb

Please sign in to comment.