You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Harness plan doesn't match Pebble's when merging layers: repeated list entries and a lost check level #2894
I compared the plan ops.testing.Harness builds from two layers with the plan the real Pebble daemon (v1.33.2) builds from the same layers, over a few hundred random base/override pairs. Apart from defaults Pebble fills in (threshold, period) and the override value it reports, two things differ.
Lists merged from an override layer are repeated on every render. _render_services, _render_checks and _render_log_targets in ops/_private/harness.py merge into the first layer's own object, so each get_plan() or get_services() call appends the override's after/before/requires (or a log target's services) again:
Pebble gives ['a', 'b']. The ops.testing container already copies before merging; Harness doesn't.
Merging a check layer that doesn't set level drops the existing level. Check._merge skips CheckStartup.UNSET but not CheckLevel.UNSET, and enum members are truthy, so level: ready from the base layer becomes UNSET. Pebble keeps ready. This affects ops.testing too, since both use Check._merge.
I have small fixes with tests for both and will open PRs.
Hi @aozmekik ! Thanks for checking this against a real Pebble rather than just reading the code.
We've already decided not to fix the first one (see #2830 and #2885, which reported the same duplicates). Harness only gets security fixes and significant bug fixes now, plus changes to code it shares with Scenario. Scenario already copies before merging, so I'm closing #2896.
The second one is a real bug, and does affect Scenario as well. It's already fixed in #2872 (split out of a larger set of Pebble fixes), so I'm closing #2895 as a duplicate, and this issue will close when #2872 is merged.
Activity
tonyandrewmeyer commentedon Nov 15, 2026
Hi @aozmekik ! Thanks for checking this against a real Pebble rather than just reading the code.
We've already decided not to fix the first one (see #2830 and #2885, which reported the same duplicates). Harness only gets security fixes and significant bug fixes now, plus changes to code it shares with Scenario. Scenario already copies before merging, so I'm closing #2896.
The second one is a real bug, and does affect Scenario as well. It's already fixed in #2872 (split out of a larger set of Pebble fixes), so I'm closing #2895 as a duplicate, and this issue will close when #2872 is merged.