When testing pebble_check_failed or pebble_check_recovered events for a container whose name contains dashes (e.g. temporal-worker), the consistency checker unconditionally raises InconsistentScenarioError even when the check_infos are correctly set on the container in the state.
I believe that n _consistency_checker.py, all_checks is built using raw container names all_checks = {(c.name, check.name) for c in state.containers for check in c.check_infos}, but evt_container_name (a bit below that) is derived from event.name, which has been normalised.
To reproduce
In a scenario test case:
check_info = ops.testing.CheckInfo("my-check", failures=3, status=ops.pebble.CheckStatus.DOWN)
container = dataclasses.replace(
state.get_container("temporal-worker"),
check_infos={check_info},
)
state = dataclasses.replace(state, containers=[container])
context.run(context.on.pebble_check_failed(container, check_info), state) # <-- will raise InconsistentScenarioError
When testing
pebble_check_failedorpebble_check_recoveredevents for a container whose name contains dashes (e.g.temporal-worker), the consistency checker unconditionally raisesInconsistentScenarioErroreven when thecheck_infosare correctly set on the container in the state.I believe that n
_consistency_checker.py,all_checksis built using raw container namesall_checks = {(c.name, check.name) for c in state.containers for check in c.check_infos}, butevt_container_name(a bit below that) is derived from event.name, which has been normalised.To reproduce
In a scenario test case: