Skip to content

feat(test): honor io_env::stop_token in capy::test awaitables (#317)#336

Merged
mvandeberg merged 1 commit into
cppalliance:develop-2from
mvandeberg:pr/317-stop-test-awaitables
Jun 24, 2026
Merged

feat(test): honor io_env::stop_token in capy::test awaitables (#317)#336
mvandeberg merged 1 commit into
cppalliance:develop-2from
mvandeberg:pr/317-stop-test-awaitables

Conversation

@mvandeberg

Copy link
Copy Markdown
Contributor

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

…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.
@cppalliance-bot

Copy link
Copy Markdown

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

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.40%. Comparing base (9144290) to head (d779220).
⚠️ Report is 4 commits behind head on develop-2.

Additional details and impacted files

Impacted file tree graph

@@              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     
Flag Coverage Δ
linux 98.40% <ø> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 94 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9144290...d779220. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cppalliance-bot

Copy link
Copy Markdown

GCOVR code coverage report https://336.capy.prtest3.cppalliance.org/gcovr/index.html
LCOV code coverage report https://336.capy.prtest3.cppalliance.org/genhtml/index.html
Coverage Diff Report https://336.capy.prtest3.cppalliance.org/diff-report/index.html

Build time: 2026-06-24 16:04:51 UTC

@mvandeberg mvandeberg merged commit 119f505 into cppalliance:develop-2 Jun 24, 2026
38 checks passed
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.

2 participants