Skip to content

Make coherent_sets_w_instances timing-independent - #94

Open
sqt wants to merge 1 commit into
omg-dds:masterfrom
zz-iot:coherent_sets_w_instances_improvements
Open

Make coherent_sets_w_instances timing-independent#94
sqt wants to merge 1 commit into
omg-dds:masterfrom
zz-iot:coherent_sets_w_instances_improvements

Conversation

@sqt

@sqt sqt commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Motivation

As it's currently written, coherent_sets_w_instances (used by Test_CoherentSets_10/11/12/19/20/21) requires that exactly 36 samples appear between consecutive Reading coherent sets lines. That's a property of the phase alignment between the subscriber's take() period and the publisher's write period (two unsynchronised sleep loops) not of the PRESENTATION coherent_access contract itself. When a poll lands mid-coherent-change the check may see 12 / 24 / 72 and will return DATA_NOT_CORRECT even though every sample was delivered, in order, in a complete coherent set.

Observed false-failure rates run from a few percent to a large majority of runs depending on the implementation pair, how the publisher orders instances on the wire, and the host load. That makes these six tests unreliable as a real test of interoperability between vendors. This is the same class of issue, and same approximate fix approach, as commit 95b6f62 ("Added tolerance to the ordered_access test").

Description of changes

This PR rewrites the body of coherent_sets_w_instances. It drives the subscriber the same way but, instead of a per-poll-cycle sample count, it collects every (topic, color, size) the subscriber prints and asserts, over the whole run:

  • Each instance's size values are strictly increasing with no duplicates (RELIABLE + KEEP_ALL: ordering, no loss);
  • If the publisher writes an instance's samples consecutively (detected from the sample stream), then for that instance every read between the first and last returns a whole multiple of --coherent-sample-count samples (i.e. an instance's coherent set is never split across take() calls). A publisher that round-robins its instances interleaves coherent sets on the wire and they can't be distinguished from stdout, so for it only the ordering check applies. That's the same visibility the previous version had.
  • all --num-topics topics and --num-instances instances per topic were discovered and several coherent sets were received.
  • No assertion about samples-per-read-cycle. The function also returns after 25 coherent sets rather than a 500-sample budget, so these tests run a bit faster.

@sqt
sqt requested a review from angelrti August 28, 2026 10:39
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.

1 participant