Skip to content

Commit

Permalink
Merge pull request #520 from WalletConnect/hotfix-timeouts
Browse files Browse the repository at this point in the history
hotfix - increase timeouts
  • Loading branch information
llbartekll authored Sep 28, 2022
2 parents 099ed68 + 0d68912 commit 76da907
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
12 changes: 7 additions & 5 deletions Example/IntegrationTests/Auth/AuthTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ final class AuthTests: XCTestCase {
let prvKey = Data(hex: "462c1dad6832d7d96ccf87bd6a686a4110e114aaaebd5512e552c0e3a87b480f")
private var publishers = [AnyCancellable]()

private let defaultTimeout: TimeInterval = 30

override func setUp() {
app = makeClient(prefix: "👻 App")
let walletAccount = Account(chainIdentifier: "eip155:1", address: "0x724d0D2DaD3fbB0C168f947B87Fa5DBe36F1A8bf")!
Expand Down Expand Up @@ -57,7 +59,7 @@ final class AuthTests: XCTestCase {
wallet.authRequestPublisher.sink { _ in
requestExpectation.fulfill()
}.store(in: &publishers)
wait(for: [requestExpectation], timeout: 2)
wait(for: [requestExpectation], timeout: defaultTimeout)
}

func testRespondSuccess() async {
Expand All @@ -76,7 +78,7 @@ final class AuthTests: XCTestCase {
responseExpectation.fulfill()
}
.store(in: &publishers)
wait(for: [responseExpectation], timeout: 5)
wait(for: [responseExpectation], timeout: defaultTimeout)
}

func testUserRespondError() async {
Expand All @@ -95,7 +97,7 @@ final class AuthTests: XCTestCase {
responseExpectation.fulfill()
}
.store(in: &publishers)
wait(for: [responseExpectation], timeout: 5)
wait(for: [responseExpectation], timeout: defaultTimeout)
}

func testRespondSignatureVerificationFailed() async {
Expand All @@ -116,7 +118,7 @@ final class AuthTests: XCTestCase {
responseExpectation.fulfill()
}
.store(in: &publishers)
wait(for: [responseExpectation], timeout: 2)
wait(for: [responseExpectation], timeout: defaultTimeout)
}

func testPing() async {
Expand All @@ -130,6 +132,6 @@ final class AuthTests: XCTestCase {
pingExpectation.fulfill()
}
.store(in: &publishers)
wait(for: [pingExpectation], timeout: 5)
wait(for: [pingExpectation], timeout: defaultTimeout)
}
}
8 changes: 5 additions & 3 deletions Example/IntegrationTests/Chat/ChatTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ final class ChatTests: XCTestCase {
var registry: KeyValueRegistry!
private var publishers = [AnyCancellable]()

private let defaultTimeout: TimeInterval = 30

override func setUp() {
registry = KeyValueRegistry()
invitee = makeClient(prefix: "🦖 Registered")
Expand Down Expand Up @@ -56,7 +58,7 @@ final class ChatTests: XCTestCase {
invitee.invitePublisher.sink { _ in
inviteExpectation.fulfill()
}.store(in: &publishers)
wait(for: [inviteExpectation], timeout: 4)
wait(for: [inviteExpectation], timeout: defaultTimeout)
}

func testAcceptAndCreateNewThread() {
Expand All @@ -83,7 +85,7 @@ final class ChatTests: XCTestCase {
newThreadInviterExpectation.fulfill()
}.store(in: &publishers)

wait(for: [newThreadinviteeExpectation, newThreadInviterExpectation], timeout: 10)
wait(for: [newThreadinviteeExpectation, newThreadInviterExpectation], timeout: defaultTimeout)
}

func testMessage() {
Expand Down Expand Up @@ -118,6 +120,6 @@ final class ChatTests: XCTestCase {
messageExpectation.fulfill()
}.store(in: &publishers)

wait(for: [messageExpectation], timeout: 10)
wait(for: [messageExpectation], timeout: defaultTimeout)
}
}
4 changes: 2 additions & 2 deletions Example/IntegrationTests/Relay/RelayClientEndToEndTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import Starscream

final class RelayClientEndToEndTests: XCTestCase {

let defaultTimeout: TimeInterval = 10

let projectId = "3ca2919724fbfa5456a25194e369a8b4"
private var publishers = Set<AnyCancellable>()

private let defaultTimeout: TimeInterval = 30

func makeRelayClient() -> RelayClient {
let clientIdStorage = ClientIdStorage(keychain: KeychainStorageMock())
let socketAuthenticator = SocketAuthenticator(
Expand Down
2 changes: 1 addition & 1 deletion Example/IntegrationTests/Sign/SignClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import WalletConnectUtils

final class SignClientTests: XCTestCase {

let defaultTimeout: TimeInterval = 8
private let defaultTimeout: TimeInterval = 30

var dapp: ClientDelegate!
var wallet: ClientDelegate!
Expand Down

0 comments on commit 76da907

Please sign in to comment.