Skip to content

Commit 552c84d

Browse files
committed
Fix Broken Test
• Travis CI consistently failed a specific test. It appears that in Travis, the logout function wasn't finishing quickly enough for an assertion.
1 parent 5f50216 commit 552c84d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

iOS_SDK/OneSignalSDK/UnitTests/EmailTests.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ - (void)testEmailSubscriptionObserver {
367367

368368
[self waitForExpectations:@[expectation] timeout:0.1];
369369

370-
NSLog(@"CHECKING REQUIRES EMAIL AUTH");
370+
[UnitTestCommonMethods runBackgroundThreads];
371+
371372
XCTAssertEqual(observer->last.to.emailAddress, @"[email protected]");
372373
XCTAssertEqual(observer->last.to.emailUserId, @"1234");
373374
XCTAssertEqual(observer->last.to.emailAuthCode, @"test-hash-token");
@@ -382,9 +383,11 @@ - (void)testEmailSubscriptionObserver {
382383
} withFailure:^(NSError *error) {
383384
XCTFail(@"Encountered error: %@", error);
384385
}];
385-
386+
386387
[self waitForExpectations:@[logoutExpectation] timeout:0.1];
387388

389+
[UnitTestCommonMethods runBackgroundThreads];
390+
388391
XCTAssertNil(observer->last.to.emailAddress);
389392
XCTAssertNil(observer->last.to.emailAuthCode);
390393
XCTAssertNil(observer->last.to.emailUserId);

0 commit comments

Comments
 (0)