feat(test): honor io_env::stop_token in capy::test awaitables (#317)#336
Conversation
…iance#317) All capy::test mock awaitables now resolve to error::canceled when the environment's stop token is requested, so code under test can exercise its cancellation paths against the mocks. The synchronous mocks check the token up front; stream::read_some wakes a blocked read via a stop callback while preserving its synchronous fast path when data is already buffered. io_env reaches an awaitable only through await_suspend, so the synchronous mocks must suspend once to observe it. They return false from await_suspend (conditional no-suspend) rather than self-transferring via the returned handle: the return-h form leaks the awaiting coroutine frame under run_async. Also removes now-unused <stop_token> includes from the any_* tests.
|
An automated preview of the documentation is available at https://336.capy.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-06-24 15:48:12 UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop-2 #336 +/- ##
=============================================
+ Coverage 98.07% 98.40% +0.32%
=============================================
Files 164 82 -82
Lines 8774 4252 -4522
=============================================
- Hits 8605 4184 -4421
+ Misses 169 68 -101
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
GCOVR code coverage report https://336.capy.prtest3.cppalliance.org/gcovr/index.html Build time: 2026-06-24 16:04:51 UTC |
All capy::test mock awaitables now resolve to error::canceled when the environment's stop token is requested, so code under test can exercise its cancellation paths against the mocks. The synchronous mocks check the token up front; stream::read_some wakes a blocked read via a stop callback while preserving its synchronous fast path when data is already buffered.
io_env reaches an awaitable only through await_suspend, so the synchronous mocks must suspend once to observe it. They return false from await_suspend (conditional no-suspend) rather than self-transferring via the returned handle: the return-h form leaks the awaiting coroutine frame under run_async.
Also removes now-unused <stop_token> includes from the any_* tests.
Closes #317