Back to catalog

pDeadManPost

H01 pDeadManPost Unit

Utility app correctness tests for pDeadManPost. These cases verify deadflag posting and suppression across active-at-start, inactive-until-first-heartbeat, stale heartbeat, custom heartbeat variables, once/repeat/reset post policies, invalid policy fallback, and typed deadflag configurations.

Stem Mission

Baseline scenario context

The stem mission runs one MOOS community with pDeadManPost and a case-generated heartbeat schedule. The harness grades exact deadflag variables and absence conditions through pMissionEval, then uses alog counts for policy cases where posting multiplicity matters.

Examples

Representative runs

Deadman Trip

Description: Starts active with max_noheart=0.5, no heartbeat mail, and DEAD_ONCE=true, testing startup arming; passes when pMissionEval observes the deadflag by time 1.5.

Heartbeat Suppression

Description: Starts inactive with a one-second timeout and sends heartbeats through time 1.4, testing that fresh mail prevents a trip; passes at time 1.6 when DEAD_KEEPALIVE remains absent.

Case Matrix

All cases

active_start_once_posts_pass

Starts active with max_noheart=0.5, no heartbeat mail, and DEAD_ONCE=true, testing startup arming; passes when pMissionEval observes the deadflag by time 1.5.

active_start_false_no_initial_post_pass

Starts inactive with no heartbeat and DEAD_NO_START=true, testing that the watchdog remains unarmed; passes when evaluation reaches time 1.5 without that deadflag.

heartbeat_before_dead_suppresses_pass

Starts inactive with a one-second timeout and sends heartbeats through time 1.4, testing that fresh mail prevents a trip; passes at time 1.6 when DEAD_KEEPALIVE remains absent.

stop_heartbeat_posts_pass

Starts inactive, uses the heartbeat at 0.2 to arm the watchdog and the heartbeat at 0.4 to refresh its 0.45-second timeout, then stops sending mail; passes when DEAD_STOP=true is first published 0.35-0.70 seconds after the second heartbeat.

active_false_after_first_heartbeat_posts_pass

Starts inactive, sends one heartbeat at 0.2, and then exceeds the 0.45-second timeout, testing first-heartbeat arming; passes when DEAD_AFTER_FIRST=true is observed by time 1.1.

numeric_deadflag_pass

Configures numeric deadflag DEAD_NUM=7.5, testing numeric payload parsing and publication; passes when pMissionEval observes exact numeric 7.5.

string_deadflag_pass

Configures string deadflag DEAD_STR=halt, testing string payload publication; passes when pMissionEval observes exact string halt.

multiple_deadflags_pass

Configures DEAD_MULTI_A=true and DEAD_MULTI_B=alpha on one watchdog, testing fan-out from a single trip; passes when both exact values are present.

once_policy_single_post_pass

Uses post_policy=once with an active stale watchdog, testing the single-shot latch; passes when DEAD_ONCE_SINGLE=true and the pre-evaluation alogs contain exactly one publication.

repeat_policy_reposts_pass

Uses post_policy=repeat with an active stale watchdog through time 1.4, testing continuous reposting; passes when DEAD_REPEAT=true and at least two publications occur.

reset_policy_reposts_after_heartbeat_pass

Uses post_policy=reset, allows one initial stale-timeout post, sends a heartbeat at 0.8 to clear the posting latch, and goes stale once more; passes when the alog contains exactly two DEAD_RESET=true publications before evaluation.

repeat_policy_inactive_reposts_pass

Starts inactive under post_policy=repeat, arms with one heartbeat at 0.2, then goes stale; passes when DEAD_REPEAT_AFTER_FIRST=true and at least two publications occur.

reset_policy_no_repost_without_heartbeat_pass

Uses post_policy=reset without any heartbeat after the initial trip, testing that the latch is not reset merely by elapsed time; passes when DEAD_RESET_SINGLE=true is published exactly once.

active_start_keepalive_suppresses_pass

Starts active with max_noheart=3.5 and sends heartbeats through time 1.8, testing fresh-mail suppression during the evaluation window; passes at time 1.6 with exactly zero DEAD_ACTIVE_KEEPALIVE publications.

custom_heartbeat_var_pass

Rebinds the heartbeat to ALT_HEART, starts inactive, and sends one ALT_HEART post before going stale; passes when DEAD_ALT_HEART=true is published at least once.

negative_deadflag_pass

Configures numeric deadflag DEAD_NEG=-3.25, testing negative-number parsing; passes when pMissionEval observes exact numeric -3.25.

zero_max_noheart_posts_pass

Sets max_noheart=0 on an active watchdog, testing that zero is accepted as an immediate timeout rather than replaced by the positive default; passes when DEAD_ZERO_MAX=true is published once and its first publication is no more than 0.90 seconds after pDeadManPost appears in DB_CLIENTS.

false_deadflag_pass

Configures DEAD_FALSE=false, testing publication of a boolean-looking false string that final-state evaluation alone could confuse with absence; passes when the value is false and the alogs contain at least one publication.

invalid_post_policy_falls_back_once_pass

Supplies post_policy=invalid_policy, testing fallback to the default once policy; passes when DEAD_INVALID_POLICY=true is published exactly once.

reset_policy_multiple_reposts_pass

Uses post_policy=reset, trips once, then sends heartbeats at 1.2 and 2.2 to re-arm two more stale intervals; passes when DEAD_RESET_MULTI=true is published exactly three times by time 3.4.

Source links

Harness README Mission README