Skip to content

Add guidance: choose observables that survive the full event sequence - #74

Merged
dwilding merged 1 commit into
mainfrom
observable-survival-guidance
Sep 7, 2026
Merged

Add guidance: choose observables that survive the full event sequence#74
dwilding merged 1 commit into
mainfrom
observable-survival-guidance

Conversation

@dwilding

@dwilding dwilding commented Sep 7, 2026

Copy link
Copy Markdown
Owner

When a test observes a side effect of an event handler (e.g. a status message), it must account for events that fire afterward. In charm frameworks, one event often triggers others — a config change can re-fire pebble-ready, which may overwrite the observable the test is waiting for. This caused a false negative in PR #73: the test waited for a status message set by config-changed, but pebble-ready fired afterward and cleared it.

Added a generic principle to the test strategy section: trace the full event sequence and choose an observable that no later handler clobbers. Suggests alternatives like StoredState, files in the container, or workload_version.

When a test observes a side effect of an event handler (e.g. a status
message), it must account for events that fire afterward. In charm
frameworks, one event often triggers others — a config change can
re-fire pebble-ready, which may overwrite the observable the test is
waiting for. This caused a false negative in PR #73: the test waited
for a status message set by config-changed, but pebble-ready fired
afterward and cleared it.

Added a generic principle to the test strategy section: trace the full
event sequence and choose an observable that no later handler clobbers.
@dwilding
dwilding merged commit 8d61862 into main Sep 7, 2026
2 checks passed
@dwilding
dwilding deleted the observable-survival-guidance branch September 7, 2026 02:02
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