Skip to content

Commit 7b62013

Browse files
authored
Merge pull request #4084 from bbirman/test-failure
Change URL for failed request test
2 parents 7d9a91b + 94f5751 commit 7b62013

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

libs/SalesforceSDKCore/SalesforceSDKCoreTests/SalesforceRestAPITests.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2517,8 +2517,10 @@ - (void)testInvalidAccessTokenWithInvalidRequest {
25172517
- (void)testFailedRequestRemovedFromQueue {
25182518

25192519
// Send a request that should fail before getting to the service.
2520+
// Use localhost with an unlikely port to get an immediate connection-refused error
2521+
// (non-existent DNS domains can hang for tens of seconds depending on the network).
25202522
NSURL *origInstanceUrl = _currentUser.credentials.instanceUrl;
2521-
_currentUser.credentials.instanceUrl = [NSURL URLWithString:@"https://some.non-existent-domain-blafhsdfh"];
2523+
_currentUser.credentials.instanceUrl = [NSURL URLWithString:@"https://localhost:2"];
25222524
self.currentExpectation = [self expectationWithDescription:@"performRequestToFail"];
25232525
SFRestRequestFailBlock failWithExpectedFail = ^(id response, NSError *e, NSURLResponse *rawResponse) {
25242526
[self.currentExpectation fulfill];

0 commit comments

Comments
 (0)