Improve NetworkTransport and add test coverage (#108)
* Improve NetworkTransport and add test coverage * Remove the weakTransport check since actors have special memory management rules * Use Task.sleep(for:) consistently * Always start connection in connect * Run NetworkTransportTests serially
This commit is contained in:
parent
266c02d2d1
commit
87f33d022a
1 changed files with 1224 additions and 32 deletions
|
|
@ -39,7 +39,7 @@ struct ServerTests {
|
|||
try await server.start(transport: transport)
|
||||
|
||||
// Wait for message processing and response
|
||||
try await Task.sleep(nanoseconds: 100_000_000) // 100ms
|
||||
try await Task.sleep(for: .milliseconds(100))
|
||||
|
||||
#expect(await transport.sentMessages.count == 1)
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ struct ServerTests {
|
|||
}
|
||||
|
||||
// Wait for server to initialize
|
||||
try await Task.sleep(nanoseconds: 10_000_000) // 10ms
|
||||
try await Task.sleep(for: .milliseconds(10))
|
||||
|
||||
// Queue an initialize request from blocked client
|
||||
try await transport.queue(
|
||||
|
|
@ -127,7 +127,7 @@ struct ServerTests {
|
|||
))
|
||||
|
||||
// Wait for message processing
|
||||
try await Task.sleep(nanoseconds: 200_000_000) // 200ms
|
||||
try await Task.sleep(for: .milliseconds(200))
|
||||
|
||||
#expect(await transport.sentMessages.count >= 1)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue