From d1562145848f172515d7ae22cf5b03db45fbb1d3 Mon Sep 17 00:00:00 2001 From: MacOMNI <414294494@qq.com> Date: Mon, 4 Nov 2024 11:36:51 +0800 Subject: [PATCH] update test cases --- .../NetworkingTests/MockPeerEventTests.swift | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Networking/Tests/NetworkingTests/MockPeerEventTests.swift b/Networking/Tests/NetworkingTests/MockPeerEventTests.swift index 15673766..1c566006 100644 --- a/Networking/Tests/NetworkingTests/MockPeerEventTests.swift +++ b/Networking/Tests/NetworkingTests/MockPeerEventTests.swift @@ -147,10 +147,10 @@ final class MockPeerEventTests { configuration: clientConfiguration ) - try? await Task.sleep(for: .milliseconds(100)) - await #expect(throws: Error.self) { - try clientConnection.connect(to: listenAddress) - try? await Task.sleep(for: .milliseconds(200)) + try? await Task.sleep(for: .milliseconds(50)) + try clientConnection.connect(to: listenAddress) + try? await Task.sleep(for: .milliseconds(1000)) + #expect(throws: Error.self) { let stream1 = try clientConnection.createStream() try stream1.send(data: Data("test data 1".utf8)) } @@ -253,10 +253,9 @@ final class MockPeerEventTests { registration: registration, configuration: clientConfiguration ) - try? await Task.sleep(for: .milliseconds(100)) - await #expect(throws: Error.self) { - try clientConnection.connect(to: listenAddress) - try? await Task.sleep(for: .milliseconds(200)) + try clientConnection.connect(to: listenAddress) + try? await Task.sleep(for: .milliseconds(1000)) + #expect(throws: Error.self) { let stream1 = try clientConnection.createStream() try stream1.send(data: Data("test data 1".utf8)) }