Skip to content

Replace Task.sleep(for:) with Task.sleep(nanoseconds:) in `EventL…#3548

Merged
rnro merged 1 commit intoapple:mainfrom
rnro:dont_use_sleep_for
Mar 12, 2026
Merged

Replace Task.sleep(for:) with Task.sleep(nanoseconds:) in `EventL…#3548
rnro merged 1 commit intoapple:mainfrom
rnro:dont_use_sleep_for

Conversation

@rnro
Copy link
Copy Markdown
Contributor

@rnro rnro commented Mar 11, 2026

…oopTest`

Motivation

  • Task.sleep(for:) and the Duration literals (.milliseconds, .seconds) require iOS 16.0+, tvOS 16.0+, and watchOS 9.0+, so these calls cause build failures on simulator test destinations in CI.

Modifications

  • Replaced all five Task.sleep(for:) calls in EventLoopTest.swift with the universally available Task.sleep(nanoseconds:).

Result

  • EventLoopTest compiles for iOS, tvOS, and watchOS simulator destinations. Verified locally with xcodebuild build-for-testing.

…oopTest`

Motivation

* `Task.sleep(for:)` and the `Duration` literals (`.milliseconds`,
  `.seconds`) require iOS 16.0+, tvOS 16.0+, and watchOS 9.0+, so
  these calls cause build failures on simulator test destinations in CI.

Modifications

* Replaced all five `Task.sleep(for:)` calls in `EventLoopTest.swift`
  with the universally available `Task.sleep(nanoseconds:)`.

Result

* `EventLoopTest` compiles for iOS, tvOS, and watchOS simulator
  destinations. Verified locally with `xcodebuild build-for-testing`.
@rnro rnro added the semver/none No version bump required. label Mar 11, 2026
@rnro rnro merged commit daec044 into apple:main Mar 12, 2026
49 of 54 checks passed
@rnro rnro deleted the dont_use_sleep_for branch March 12, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants