prometheus / prometheus/client_python
TestGauge::test_time_block_decorator_with_label failure
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 876
- Avg merge
- 8d 4h
- Merged PRs (30d)
- 1
Description
Hi, I am running the test suite on some obscure architectures and observed a failure on alpha, with one test:
========================================================================= FAILURES =========================================================================
______________________________________________________ TestGauge.test_time_block_decorator_with_label ______________________________________________________
self = <tests.test_core.TestGauge testMethod=test_time_block_decorator_with_label>
def test_time_block_decorator_with_label(self):
value = self.registry.get_sample_value
self.assertEqual(None, value('g2', {'label1': 'foo'}))
with self.gauge_with_label.time() as metric:
metric.labels('foo')
> self.assertLess(0, value('g2', {'label1': 'foo'}))
E AssertionError: 0 not less than 0.0
metric = <prometheus_client.context_managers.Timer object at 0x20007441790>
self = <tests.test_core.TestGauge testMethod=test_time_block_decorator_with_label>
value = <bound method CollectorRegistry.get_sample_value of <prometheus_client.registry.CollectorRegistry object at 0x20007441310>>
tests/test_core.py:255: AssertionError
This is fully reproducible, and I tested on both python3.10 and python3.11 with same results.
Complete log: 41y0768.log
Any help on why this test could be failing? I know this is an unusual platform, so I can provide shell access to the machine in question if somebody would mind taking a look. I can also interactively debug, or test patches as needed.
Thank you!
Contributor 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.
Research direction
Start with tests/test_core.py:255 and the TestGauge.test_time_block_decorator_with_label test. Reproduce the failure on the reported alpha platform with Python 3.10 or 3.11, then inspect the complete 41y0768.log and the gauge timing behavior. Done means the platform-specific cause is identified and the test passes without regressing the reported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100