Repository navigation
tests(state): robust margins and deterministic ordering for the wait/future tests - #631
Merged
Merged
Conversation
…stic ordering StateTestFixture.WaitForValueWithTimeout failed on a loaded windows-2022 runner (#630, recipe / windows-2022 / Release): cvc::timeout_error: Timeout waiting for state value to be initialized after 345 ms. Its success half started a writer that sleeps 50 ms and allowed the wait only 200 ms, and the runner took longer than that to schedule the write. Several neighbouring tests had the same weakness or a worse one: - WaitForValueWithTimeout, WaitForDataWithTimeout and ValueFutureGetFor (50 ms writer, 200 ms wait) and FutureProducerConsumerPattern (1 s per item): waits that are expected to SUCCEED now use kSucceedWait (5 s). They return as soon as the write lands, so passing runs take as long as before. The halves that are expected to time out keep their short 50 ms waits on keys nothing writes. - ValueFutureGet: a state_future sees only writes made after it connects (it listens to valueChanged). The writer slept 100 ms and the future was created after the thread started, so on a slow runner the future could miss the write, and future.get() would then block forever. The future is now created first, and the writer waits on a go signal released after the not-ready check. - MultipleFuturesOnSameState: the same miss through a fixed 50 ms "give threads time" sleep. A boost::barrier now holds the write until all five futures are connected. ValueFutureWaitFor needed nothing: the setter emits valueChanged synchronously. Verified on Windows (MSVC 2022, local cvcpkg prefix): - the nine wait/future tests pass 50/50 repeats; - under load, 12 concurrent processes x 20 repeats: 240/240; - the full state_test passes, 164 tests; - ValueFutureGet and MultipleFuturesOnSameState now finish in about 1 ms instead of 100 and 50 ms; - git clang-format against master reports nothing.
transfix
added a commit
that referenced
this pull request
Oct 17, 2026
Minor release. It carries: - the world clock: lockstep and batch, followers, the sim.* binding, and nav on the clock (#629, #630, #631, #640); - the units registry with SI <-> normalized-frame conversions (#632); - cvc::physics with the Jolt backend (#641); - the material trainer on the kinematic bicycle and its pycvc bindings (#642). Bumps project(VERSION) 3.5.1 -> 3.6.0 and every cvcpkg recipe's upstream_version to match. cvc_revision stays 1, per the recipe-version gate.
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.
StateTestFixture.WaitForValueWithTimeout failed on a loaded windows-2022
runner (#630, recipe / windows-2022 / Release):
after 345 ms. Its success half started a writer that sleeps 50 ms and allowed
the wait only 200 ms, and the runner took longer than that to schedule the
write. Several neighbouring tests had the same weakness or a worse one:
(50 ms writer, 200 ms wait) and FutureProducerConsumerPattern (1 s per
item): waits that are expected to SUCCEED now use kSucceedWait (5 s). They
return as soon as the write lands, so passing runs take as long as before.
The halves that are expected to time out keep their short 50 ms waits on
keys nothing writes.
(it listens to valueChanged). The writer slept 100 ms and the future was
created after the thread started, so on a slow runner the future could
miss the write, and future.get() would then block forever. The future is
now created first, and the writer waits on a go signal released after the
not-ready check.
threads time" sleep. A boost::barrier now holds the write until all five
futures are connected.
ValueFutureWaitFor needed nothing: the setter emits valueChanged
synchronously.
Verified on Windows (MSVC 2022, local cvcpkg prefix):
instead of 100 and 50 ms;