Initial release

This commit is contained in:
aculix committed 2026-09-28 18:28:32 +05:30
commit 4b67728cce
108 files changed
+13310

No files matched your search

@@ -0,0 +1,19 @@
import Testing
/// For work on other executors; controller timers run on the `TestClock` and never need it.
@MainActor
func waitUntil(
_ description: String,
timeout: Duration = .seconds(5),
sourceLocation: SourceLocation = #_sourceLocation,
_ condition: @MainActor () -> Bool
) async {
let deadline = ContinuousClock.now + timeout
while !condition() {
if ContinuousClock.now >= deadline {
Issue.record("Timed out waiting until \(description)", sourceLocation: sourceLocation)
return
}
do { try await Task.sleep(for: .milliseconds(1)) } catch { return }
}
}