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

Tickets/dm-47795 #181

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/news/DM-47795.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IN ``mtcs.py``, wait for both primary and secondary bump tests to finish to avoid a race condition where the last actuator has its test cancelled due to exiting engineering mode on M1M3.
16 changes: 14 additions & 2 deletions python/lsst/ts/observatory/control/maintel/mtcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1447,18 +1447,30 @@ async def _wait_bump_test_ok(
done = (primary_status == MTM1M3.BumpTest.PASSED if primary else True) and (
secondary_status == MTM1M3.BumpTest.PASSED if secondary else True
)
primary_testing = (
primary_status not in {MTM1M3.BumpTest.PASSED, MTM1M3.BumpTest.FAILED}
and primary
)
secondary_testing = (
secondary_status not in {MTM1M3.BumpTest.PASSED, MTM1M3.BumpTest.FAILED}
and secondary
)

if done:
self.log.info(
f"Bump test for actuator {actuator_id} completed: "
f"{primary_status!r}[{primary}], {secondary_status!r}[{secondary}]"
)
return
elif primary and primary_status == MTM1M3.BumpTest.FAILED:
elif (
primary and primary_status == MTM1M3.BumpTest.FAILED
) and not secondary_testing:
raise RuntimeError(
f"Primary bump test failed for actuator {actuator_id}."
)
elif secondary and secondary_status == MTM1M3.BumpTest.FAILED:
elif (
secondary and secondary_status == MTM1M3.BumpTest.FAILED
) and not primary_testing:
raise RuntimeError(
f"Secondary bump test failed for actuator {actuator_id}."
)
Expand Down
13 changes: 0 additions & 13 deletions tests/maintel/test_mtcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1707,19 +1707,6 @@ async def test_run_m1m3_actuator_bump_test_both_fail(self) -> None:
secondary_status,
) = await self.mtcs.get_m1m3_bump_test_status(actuator_id=actuator_id)

assert primary_status == idl.enums.MTM1M3.BumpTest.FAILED
assert secondary_status != idl.enums.MTM1M3.BumpTest.FAILED

with pytest.raises(RuntimeError):
await self.mtcs._wait_bump_test_ok(
actuator_id=actuator_id, primary=False, secondary=True
)

(
primary_status,
secondary_status,
) = await self.mtcs.get_m1m3_bump_test_status(actuator_id=actuator_id)

assert primary_status == idl.enums.MTM1M3.BumpTest.FAILED
assert secondary_status == idl.enums.MTM1M3.BumpTest.FAILED

Expand Down
Loading