-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Description
Executing inside of an XCTest
class' test case method, that calls await
on multiple consecutive async let
s of which the async function resides in a lazy initialized variable, doesn't go on to run each function concurrently. Instead, only the first async function is called, the next async function doesn't get called concurrently. Targeting macOS or iOS Simulator yields the same result.
Steps to reproduce
- Clone example repo containing Swift Package
- Change directory to
SwiftStructuredConcurrencyLazyBug
- Run
swift test
Expected behavior
Executing inside of an XCTest class' test case method, that calls await
on multiple consecutive async let
s of which the async function resides in a lazy initialized variable, should run each function concurrently.
Environment
- swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
Target: x86_64-apple-macosx13.0 - Xcode 14.2 Build version 14C18
- Deployment target: macOS 13, iOS 16
Additional context
I can't reproduce this behaviour outside of an XCTest
class. See Swift Playground SwiftStructuredConcurrencyLazy
in example repo.