Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certain tests still fail randomly in CI #748

Closed
prjemian opened this issue Oct 21, 2022 · 13 comments · Fixed by #791, #792 or #809
Closed

Certain tests still fail randomly in CI #748

prjemian opened this issue Oct 21, 2022 · 13 comments · Fixed by #791, #792 or #809
Assignees
Labels
Milestone

Comments

@prjemian
Copy link
Contributor

prjemian commented Oct 21, 2022

Until it is understood why certain tests fail have random failures in CI, mark them with @pytest.mark.local.

Originally posted by @prjemian in #747 (comment)

@prjemian prjemian added this to the 1.6.10 milestone Oct 21, 2022
@prjemian prjemian added this to To do in 1.6.11 project via automation Oct 21, 2022
@prjemian prjemian added the bug label Oct 21, 2022
@prjemian prjemian self-assigned this Oct 21, 2022
@prjemian
Copy link
Contributor Author

Since the CI workflow takes so long to complete (cycle times can be >10m), consider diagnosing this in a separate Repo.

@prjemian
Copy link
Contributor Author

CI is passing now, skipping all tests marked pytest.mark.local. Need to enable these tests in CI to observe if marked tests continue to fail.

prjemian added a commit that referenced this issue Jan 28, 2023
prjemian added a commit that referenced this issue Jan 28, 2023
@prjemian prjemian moved this from To do to In progress in 1.6.11 project Jan 28, 2023
prjemian added a commit that referenced this issue Jan 28, 2023
1.6.11 project automation moved this from In progress to Done Jan 28, 2023
@prjemian
Copy link
Contributor Author

Failed again, locally:

assert abs(rb - sp) <= tol, f"setpoint={sp}, readback={rb}, tolerance={tol}"

@prjemian prjemian reopened this Jan 28, 2023
1.6.11 project automation moved this from Done to In progress Jan 28, 2023
@prjemian
Copy link
Contributor Author

Replace failing assert per stackoverflow. (Function to determine if two numbers are nearly equal when rounded to n significant decimal digits)

@prjemian
Copy link
Contributor Author

We've got a tolerance, not the number of sig figs. Thus, use math.isclose() over numpy.testing.assert_approx_equal().

prjemian added a commit that referenced this issue Jan 28, 2023
TST #748 refactor the assertion of almost equal
1.6.11 project automation moved this from In progress to Done Jan 28, 2023
@prjemian
Copy link
Contributor Author

Again! Different place.

        assert round(pos.readback.get(use_monitor=False), 2) == known_start_position
>       assert pos.inposition, f"target={pos.setpoint.get()}, readback={pos.position}"
E       AssertionError: target=-1.0, readback=-1.0
E       assert False
E        +  where False = PVPositionerSoftDoneWithStop(prefix='gp:gp:', name='pos', settle_time=0.0, timeout=None, read_attrs=['readback', 'setpoint'], configuration_attrs=['done', 'tolerance', 'target'], limits=None, egu='').inposition

/home/runner/work/apstools/apstools/apstools/devices/tests/test_positioner_soft_done.py:321: AssertionError

@prjemian prjemian reopened this Jan 28, 2023
1.6.11 project automation moved this from Done to In progress Jan 28, 2023
prjemian added a commit that referenced this issue Jan 28, 2023
@prjemian
Copy link
Contributor Author

Another:

>       assert math.isclose(rb, sp, abs_tol=positioner.actual_tolerance)
E       AssertionError: assert False
E        +  where False = <built-in function isclose>(0.0, -1.0, abs_tol=1e-05)
E        +    where <built-in function isclose> = math.isclose
E        +    and   1e-05 = PVPositionerSoftDoneWithStop(prefix='', name='calcpos', settle_time=0.0, timeout=None, read_attrs=['readback', 'setpoint'], configuration_attrs=['done', 'tolerance', 'target'], limits=None, egu='').actual_tolerance

/home/runner/work/apstools/apstools/apstools/devices/tests/test_positioner_soft_done.py:275: AssertionError

@prjemian
Copy link
Contributor Author

The setpoint is new but the readback suggests the positioner has not moved. Perhaps the problem lies in the implementation code, not the test code?

prjemian added a commit that referenced this issue Jan 31, 2023
prjemian added a commit that referenced this issue Jan 31, 2023
prjemian added a commit that referenced this issue Feb 1, 2023
prjemian added a commit that referenced this issue Feb 1, 2023
prjemian added a commit that referenced this issue Feb 1, 2023
prjemian added a commit that referenced this issue Feb 1, 2023
prjemian added a commit that referenced this issue Feb 1, 2023
prjemian added a commit that referenced this issue Feb 1, 2023
prjemian added a commit that referenced this issue Feb 1, 2023
@prjemian prjemian removed this from In progress in 1.6.11 project Feb 1, 2023
@prjemian prjemian added this to Needs triage in 1.6.14 project via automation Feb 1, 2023
@prjemian prjemian modified the milestones: 1.6.11, 1.6.12 Feb 1, 2023
prjemian added a commit that referenced this issue Feb 1, 2023
…ftDone

test that positioner is in position #748
@prjemian prjemian moved this from Needs triage to High priority in 1.6.14 project Feb 10, 2023
@prjemian prjemian moved this from High priority to Needs triage in 1.6.14 project Feb 16, 2023
prjemian added a commit that referenced this issue Feb 16, 2023
prjemian added a commit that referenced this issue Feb 16, 2023
@prjemian prjemian moved this from Needs triage to High priority in 1.6.14 project Feb 16, 2023
prjemian added a commit that referenced this issue Feb 16, 2023
prjemian added a commit that referenced this issue Feb 16, 2023
prjemian added a commit that referenced this issue Feb 16, 2023
prjemian added a commit that referenced this issue Feb 16, 2023
prjemian added a commit that referenced this issue Feb 17, 2023
@prjemian
Copy link
Contributor Author

Replace the three tests. For now, restore the @pytest.mark.local decorator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
1.6.14 project
  
Closed
1 participant