From 7b3cd78704a73de07c2e27bbaf181a48797a93b1 Mon Sep 17 00:00:00 2001 From: MacOMNI <414294494@qq.com> Date: Thu, 14 Nov 2024 15:49:38 +0800 Subject: [PATCH] update test --- Networking/Tests/NetworkingTests/PeerTests.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Networking/Tests/NetworkingTests/PeerTests.swift b/Networking/Tests/NetworkingTests/PeerTests.swift index 6bb1157a..e6f384dc 100644 --- a/Networking/Tests/NetworkingTests/PeerTests.swift +++ b/Networking/Tests/NetworkingTests/PeerTests.swift @@ -184,9 +184,10 @@ struct PeerTests { let con = try peer.connect(to: centerPeer.listenAddress(), role: .builder) try await con.ready() } - try? await Task.sleep(for: .milliseconds(2000)) + // Simulate close connections 3~5s + try? await Task.sleep(for: .milliseconds(5000)) centerPeer.broadcast(kind: .uniqueA, message: .init(kind: .uniqueA, data: Data("connection rotation strategy".utf8))) - try? await Task.sleep(for: .milliseconds(200)) + try? await Task.sleep(for: .milliseconds(1000)) var receivedCount = 0 for handler in handlers { receivedCount += await handler.receivedData.count