Random failure in test_triangle_inequality seen in ci
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 459
- Forks
- 359
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 73
Description
```
___________________________ test_triangle_inequality ___________________________
[gw0] linux -- Python 3.7.13 /opt/hostedtoolcache/Python/3.7.13/x64/bin/python
@given(
> random_coordinates["cylindrical"],
random_coordinates["spherical"]
)
/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/qcodes/tests/test_field_vector.py:95:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cylindrical0 = FieldVector(x=1.9984014443252818e-15, y=0.0, z=0.0)
spherical0 = FieldVector(x=0.9975640502598242, y=0.0, z=-0.0[69](https://github.com/QCoDeS/Qcodes/runs/7515516370?check_suite_focus=true#step:10:70)7564[73](https://github.com/QCoDeS/Qcodes/runs/7515516370?check_suite_focus=true#step:10:74)[74](https://github.com/QCoDeS/Qcodes/runs/7515516370?check_suite_focus=true#step:10:75)412533)
@given(
random_coordinates["cylindrical"],
random_coordinates["spherical"]
)
@settings(max_examples=10)
def test_triangle_inequality(cylindrical0, spherical0):
cylindrical0 = FieldVector(**dict(zip(["rho", "phi", "z"], cylindrical0)))
spherical0 = FieldVector(**dict(zip(["r", "phi", "theta"], spherical0)))
> assert (cylindrical0 + spherical0).norm() \
<= (cylindrical0.norm() + spherical0.norm())
E assert 1.000000000000002 <= (1.9984014443252818e-15 + 0.9999999999999999)
E + where 1.000000000000002 = ()
E + where = (FieldVector(x=1.9984014443252[81](https://github.com/QCoDeS/Qcodes/runs/7515516370?check_suite_focus=true#step:10:82)8e-15, y=0.0, z=0.0) + FieldVector(x=0.997564050259[82](https://github.com/QCoDeS/Qcodes/runs/7515516370?check_suite_focus=true#step:10:83)42, y=0.0, z=-0.06975647374412533)).norm
E + and 1.99[84](https://github.com/QCoDeS/Qcodes/runs/7515516370?check_suite_focus=true#step:10:85)014443252818e-15 = ()
E + where = FieldVector(x=1.9984014443252818e-15, y=0.0, z=0.0).norm
E + and 0.9999999999999999 = ()
E + where = FieldVector(x=0.9975640502598242, y=0.0, z=-0.06975647374412533).norm
/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/qcodes/tests/test_field_vector.py:103: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_triangle_inequality(
spherical0=(1.0, 0.0, [94](https://github.com/QCoDeS/Qcodes/runs/7515516370?check_suite_focus=true#step:10:95).0),
cylindrical0=(1.9[98](https://github.com/QCoDeS/Qcodes/runs/7515516370?check_suite_focus=true#step:10:99)4014443252818e-15, 0.0, 0.0),
)
You can reproduce this example by temporarily adding @reproduce_failure('6.53.0', b'AXicY2CAAUYGbCAOiA9DmCxYFTAAACQsASc=') as a decorator on your test case
```
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 qcodes/tests/test_field_vector.py, especially test_triangle_inequality around line 95, and reproduce the Hypothesis example provided in the report. Investigate why the assertion fails for the shown cylindrical and spherical values; done means the test no longer fails intermittently in CI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100