Testing Pebble keeps a check `threshold` of 0 rather than defaulting it to 3
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 71/100
Research direction
Read the threshold defaulting checks in ops/_private/harness.py and testing/src/scenario/_consistency_checker.py, then compare them with the Pebble behavior linked in the issue. Reproduce the layer with threshold 0, combine=True, and replan(); done means the charm and consistency checker report the same default threshold as real Pebble. The issue suggests handling this once as part of #2923.
Written by the indexing model from the issue text.
Description
Pebble treats a check threshold of 0 the same as an unset one, and replaces it with the default of 3 when it combines the layers. Our testing Pebble only fills in the default for None, so with threshold: 0 in a layer the charm sees a threshold of 0, and the consistency checker then rejects a CheckInfo that has the value real Pebble would report:
$ python threshold.py
charm sees threshold: 0
output state CheckInfo threshold: [0]
InconsistentScenarioError Inconsistent scenario. The following errors were found: container 'foo' has a check 'c' with a different 'threshold' (3) than the plan (0).
The layer is {'checks': {'c': {'override': 'replace', 'threshold': 0, 'exec': {'command': 'true'}}}}, added with combine=True and then replan().
The is None checks are in Harness (and twice more in the same file) and in the consistency checker. Changing them to treat 0 as unset should be enough, although it would be better done once, as part of #2923.
A threshold of 0 doesn't do anything useful, so I doubt any charm sets it, hence rainy day.
- Dominant language
- Python
- Stars
- 267
- Forks
- 156
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 43
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from canonical/operator
-
tests
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 3 days
-
Cleaning up inconsistencies in the Manage relations how-to pagePossibly taken @tromai claimed this 1 day ago. Opendocs roadmap
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
canonical/operator#2688 · 3 comments · 1 assignee ·
Maintainers usually reply within 3 days
-
docs rainy day tests
Difficulty 3/5 1-2 days Newbie friendliness 56/100
canonical/operator#2952 · 1 reaction ·
Maintainers usually reply within 3 days
-
docs rainy day
Difficulty 3/5 1-2 days Newbie friendliness 43/100
Maintainers usually reply within 3 days
-
rainy day
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 3 days
All issues in canonical/operator
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
abetlen/llama-cpp-python#2424 ·
Maintainers usually reply within 1 day
-
Bug IronPython Python 3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pyrevitlabs/pyRevit#4184 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 74/100
jqueryscript/awesome-claude-code#1009 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
[Plugin] 群聊记忆 · 人格养成Open
Difficulty 1/5 1-3 hours Newbie friendliness 74/100