No auto-dispose in deadline test

Use of an auto-dispose writer meant the NO_WRITERS case did not actually
get tested.  The behaviour of the implementation was to generate
deadline missed notifications for such instances, but the test expected
otherwise.

There is a disagreement between different DDS implementations on the
desirability of generating deadline missed notifications for NOT_ALIVE
instances.  Deadline notifications on DISPOSED instances seems silly, as
it means end-of-life.  Deadline notifications on a NO_WRITERS instance
are certainly valuable for applications that don't pay attention to the
number of writers (otherwise one has to monitor both liveliness changed
and deadline missed notifications to be be sure to get some
notification).

Different usage patterns definitely affect what is desirable and I doubt
one-size-fits-all is the right approach.  This commit changes the test
and retains the behaviour, and if it errs, it at least errs on the side
of caution.

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2020-04-29 19:50:52 +02:00 committed by eboasson
parent 347b6edf04
commit 0be287b67b

View file

@ -125,6 +125,7 @@ static void deadline_init(void)
dds_qset_history(g_qos, DDS_HISTORY_KEEP_ALL, DDS_LENGTH_UNLIMITED); dds_qset_history(g_qos, DDS_HISTORY_KEEP_ALL, DDS_LENGTH_UNLIMITED);
dds_qset_durability(g_qos, DDS_DURABILITY_TRANSIENT_LOCAL); dds_qset_durability(g_qos, DDS_DURABILITY_TRANSIENT_LOCAL);
dds_qset_reliability(g_qos, DDS_RELIABILITY_RELIABLE, DDS_INFINITY); dds_qset_reliability(g_qos, DDS_RELIABILITY_RELIABLE, DDS_INFINITY);
dds_qset_writer_data_lifecycle(g_qos, false);
} }
static void deadline_fini(void) static void deadline_fini(void)
@ -422,7 +423,10 @@ CU_Theory((int32_t n_inst, uint8_t unreg_nth, uint8_t dispose_nth), ddsc_deadlin
n_dispose++; n_dispose++;
} }
} }
n_alive = n_inst - n_dispose - n_unreg; /* FIXME: should unregistered instances cause deadline expirations? I do think so
and that is what it actually implemented
if they shouldn't: n_alive = n_inst - n_dispose - n_unreg */
n_alive = n_inst - n_dispose;
/* Sleep deadline_dur + 50% and check missed deadline count */ /* Sleep deadline_dur + 50% and check missed deadline count */
sleepfor(3 * deadline_dur / 2); sleepfor(3 * deadline_dur / 2);