Skip to content

Use Swift.CancellationError in Task.sleepUntilCancelled - #269

Merged
swhitty merged 1 commit into
mainfrom
fix-cancellationerror-warning
Nov 15, 2026
Merged

swhitty merged 1 commit into
mainfrom
fix-cancellationerror-warning

Conversation

@swhitty

@swhitty swhitty commented Nov 15, 2026

Copy link
Copy Markdown
Owner

The Task.sleepUntilCancelled() test helper added in #265 throws CancellationError(). Inside an extension of Task, that name resolves to the deprecated Task.CancellationError, which produces a deprecation warning. Writing Swift.CancellationError() removes the warning.

This changes test code only. The test that uses the helper, handlerTimeout_Returns500, still passes.

Inside an extension of Task, CancellationError() resolves to the deprecated
Task.CancellationError, which produces a deprecation warning.
@codecov

codecov Bot commented Nov 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.70%. Comparing base (f17d86c) to head (dd67ac0).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #269      +/-   ##
==========================================
- Coverage   93.80%   93.70%   -0.10%     
==========================================
  Files          74       74              
  Lines        4035     4035              
==========================================
- Hits         3785     3781       -4     
- Misses        250      254       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@swhitty
swhitty merged commit 6a19d34 into main Nov 15, 2026
15 of 28 checks passed
@swhitty
swhitty deleted the fix-cancellationerror-warning branch November 15, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant