Skip to content

Fix remaining issues with parallel unit-tests and enable in CI#10780

Draft
jschmidt-icinga wants to merge 8 commits intomasterfrom
enable-parallel-testing
Draft

Fix remaining issues with parallel unit-tests and enable in CI#10780
jschmidt-icinga wants to merge 8 commits intomasterfrom
enable-parallel-testing

Conversation

@jschmidt-icinga
Copy link
Copy Markdown
Contributor

@jschmidt-icinga jschmidt-icinga commented Apr 2, 2026

Description

This PR enables and fixes parallel unit-test execution on the Github Runners.

It has been split off from #10767 because the debugging loop around the ARM64 container image was very time intensive and was holding up the review of the PR. Also, more fixes will be necessary than fit into the scope of that PR.

PS: The newest push contains an additional fix (hopefully) for the build issues reported in #10811. This is probably out of scope for this PR, so my plan is, once we have confirmed that all issues are fixed, move the production code fixes for PerfdataWriterConnection into one or more separate PRs and leave only the fixes related to parallel test here.

@cla-bot cla-bot Bot added the cla/signed label Apr 2, 2026
@jschmidt-icinga jschmidt-icinga changed the title Enable parallel testing Enable parallel unit-test execution Apr 2, 2026
@jschmidt-icinga jschmidt-icinga force-pushed the enable-parallel-testing branch from e66682f to 09eaa19 Compare April 2, 2026 14:04
Base automatically changed from certificate_fixture_two_electric_boogaloo to master April 7, 2026 07:35
@jschmidt-icinga jschmidt-icinga added this to the 2.17.0 milestone Apr 16, 2026
@jschmidt-icinga jschmidt-icinga force-pushed the enable-parallel-testing branch 2 times, most recently from e14ad02 to da581a1 Compare April 21, 2026 14:41
@jschmidt-icinga jschmidt-icinga force-pushed the enable-parallel-testing branch 3 times, most recently from c81a497 to fa1c1d2 Compare April 22, 2026 11:43
@jschmidt-icinga jschmidt-icinga added the backport-to-support/2.16 PRs with this label will automatically be backported to the v2.16 support branch. label Apr 23, 2026
@jschmidt-icinga jschmidt-icinga changed the title Enable parallel unit-test execution Fix remaining issues with parallel unit-test execution and enable in CI Apr 23, 2026
@jschmidt-icinga jschmidt-icinga changed the title Fix remaining issues with parallel unit-test execution and enable in CI Fix remaining issues with parallel unit-tests and enable in CI Apr 23, 2026
@jschmidt-icinga jschmidt-icinga force-pushed the enable-parallel-testing branch 2 times, most recently from e581409 to 1b568ac Compare April 29, 2026 11:31
This isn't strictly necessary, but since tests are now running
in parallel, it doesn't hurt to give slower machines more time
to complete these tests and this gives a little more headroom
for potential changes that subtly affect the behavor of the
components involved (like boost new versions).
The issue occurs when ::Connect in `EnsureConnected()` returns after
`Disconnect()` has already set `m_Stopped` to true. By adding a check
and throwing an exception before entering `async_handshake()` the
behavior should now always be consistent.
The issue is that std::promise internally also used thread local
storage, in a call to `std::call_once` in `std::promise::set_value()`.
The theory is that since all paths in `Send()` run this `std::call_once`
routine and from then on, then Coroutine function looks like a normal
function, the compiler inlined `set_value()` and moved the common parts
of it to a common location for all paths before the suspension point in
WriteMessage(yc).

When finally the coroutine is resumes, it is likely that that happens
under a different thread, which still has `__once_callable` in
`std::call_once` set as `nullptr`, leading to the segmentation fault.

The fix is to not use std::promise across coroutine suspension points
and instead reimplement the functionality we required from it in a small
helper class `SyncResult` that does not require any thread local storag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-support/2.16 PRs with this label will automatically be backported to the v2.16 support branch. cla/signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant