stdcoroutine-3: Migrate coroutine tests from Boost.Coroutine to C++20 coroutines#6428
Draft
pratikmankawde wants to merge 5 commits intopratik/std-coro/migrate-entry-pointsfrom
Draft
Conversation
e807a3a to
e6d78aa
Compare
3ee0341 to
9d79af8
Compare
e6d78aa to
5a0e822
Compare
This was referenced Feb 26, 2026
Draft
9d79af8 to
f451347
Compare
5a0e822 to
9445ed1
Compare
f451347 to
ecc6093
Compare
9445ed1 to
deb4613
Compare
ecc6093 to
7f99b08
Compare
deb4613 to
61a87db
Compare
7f99b08 to
f7fd476
Compare
61a87db to
3e37424
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## pratik/std-coro/migrate-entry-points #6428 +/- ##
======================================================================
Coverage ? 79.8%
======================================================================
Files ? 850
Lines ? 67854
Branches ? 7562
======================================================================
Hits ? 54135
Misses ? 13719
Partials ? 0 🚀 New features to boost your workflow:
|
f7fd476 to
75b8ba0
Compare
3e37424 to
00cf265
Compare
75b8ba0 to
d9d72d5
Compare
00cf265 to
e12ae19
Compare
7c510de to
677c982
Compare
199ed94 to
70f96cd
Compare
677c982 to
28fe438
Compare
70f96cd to
ed9cf56
Compare
28fe438 to
bdd3659
Compare
ed9cf56 to
91daa1f
Compare
bdd3659 to
666cafc
Compare
…0 coroutines Rewrite all test coroutine code to use postCoroTask() and co_await runner->suspend() instead of the old postCoro() / Coro::yield() API: - Coroutine_test: Migrate correct_order, incorrect_order, and thread_specific_storage tests. Replace shared_ptr<JobQueue::Coro> with shared_ptr<JobQueue::CoroTaskRunner>, yield() with co_await runner->suspend(). - JobQueue_test: Rename testPostCoro to testPostCoroTask. Migrate all 3 sub-tests (repeated post, repeated resume, shutdown rejection) to the new API. After this change, zero .cpp files reference postCoro() or JobQueue::Coro. The old API declarations remain in JobQueue.h and Coro.ipp for removal in the cleanup milestone. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
clang-format auto-formatting adjustments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CoroTask.h is already transitively included via JobQueue.h. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Defense-in-depth against a GCC 14 bug where reference captures in coroutine lambdas are corrupted in the coroutine frame. The root cause is fixed in CoroTaskRunner::init() (heap storage), but using explicit pointer captures avoids any residual risk. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
91daa1f to
ddaa264
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
High Level Overview of Change
Rewrite
Coroutine_test.cppandJobQueue_test.cppto usepostCoroTask()andco_await runner->suspend()instead of the oldpostCoro()/Coro::yield()API. After this change, zero.cppfiles referencepostCoro()orJobQueue::Coro.Context of Change
This is Milestone 3 of the Boost.Coroutine → C++20 coroutines migration. Milestone 2 (
pratik/std-coro/migrate-entry-points) migrated all production entry points. This milestone completes the migration of the last remaining callers — the test files.pratik/std-coro/add-coroutine-primitives): AddedCoroTask<T>,CoroTaskRunner,JobQueueAwaiter,postCoroTask()pratik/std-coro/migrate-entry-points): Migrated all production entry pointspratik/std-coro/migrate-test-code): Migrated all test codeCoroutine_test (3 tests):
correct_order:postCoro→postCoroTask,yield()→co_await runner->suspend()incorrect_order: Same migration. Thepost()-before-suspend()pattern remains safe becauseCoroTaskRunner::mutex_serializes resume calls — the posted job'sresume()blocks until the currentresume()releases the lock after the coroutine suspends.thread_specific_storage:shared_ptr<Coro>→shared_ptr<CoroTaskRunner>, same suspend/resume pattern.JobQueue_test (
testPostCoro→testPostCoroTask, 3 sub-tests):post()until completionresume()(synchronous) until completionpostCoroTaskreturnsnullptr)Type of Change
API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)Future Tasks
Coro.ipp, remove oldCoroclass andpostCoro()fromJobQueue.h, remove Boost.Coroutine from CMake/Conan dependencies