Skip to content

Commit 5803fb1

Browse files
committed
Ensure the mock URLSession waits until the main actor yields
1 parent 48a0d76 commit 5803fb1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Tests/TestCommon/URLSessionMock.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ class URLSessionMock: URLSessionProtocol, @unchecked Sendable {
124124

125125
return try await withCheckedThrowingContinuation { continuation in
126126
Task {
127+
await MainActor.yield()
127128
if let delay = requestDelay {
128129
try await Task.sleep(delay: delay)
129130
}

0 commit comments

Comments
 (0)