-
Notifications
You must be signed in to change notification settings - Fork 0
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-47223: Prepare _wait_hard_point_test_ok method in MTCS for parallelization #179
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some small comments I hope you can address before I can approve it.
doc/news/DM-47223.feature.rst
Outdated
@@ -0,0 +1,2 @@ | |||
Update ``_wait_hard_point_test_ok`` method in ``MTCS`` to be compatible with | |||
concurrent executions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For documentation in general we adopted something called "semantic line break". Basically it means that each phrase should be in one line. Please, make sure this is all in one line.
hp_test_state = MTM1M3.HardpointTest( | ||
( | ||
await self.rem.mtm1m3.evt_hardpointTestStatus.next( | ||
await self.rem.mtm1m3.evt_hardpointTestStatus.aget( | ||
flush=False, timeout=self.timeout_hardpoint_test_status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aget
does not have a flush
parameter.
@@ -1302,6 +1305,10 @@ async def _wait_hard_point_test_ok(self, hp: int) -> None: | |||
else: | |||
self.log.info(f"Hard point {hp} test state: {hp_test_state!r}.") | |||
|
|||
await self.rem.mtm1m3.evt_heartbeat.next( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you might want to wrap this await here with a try/except
and catch and treat timeout errors. It might be hard for users to understand why there is a heartbeat timeout coming from this loop. Consider something like:
try:
await self.rem.mtm1m3.evt_heartbeat.next(...)
expect asyncio.TimeoutError:
raise RuntimeError(f"No heartbeat received from M1M3 in the last {self.timeout_hardpoint_test_status}s while waiting for hard point data information. Check CSC liveliness.")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I'm also adding a unit test for this case.
Update the wait method for hardpoint tests to be ok in order to make it compatible with concurrent executions. Using next will pop the data from the queue so it might happen that one execution will “steal” the event for the other and vice versa. This commit changes next to aget and adds a sleep to avoid that.
9c00be6
to
66357a2
Compare
Update the wait method for hardpoint tests to be ok in order to make it compatible with concurrent executions.
Using
next
will pop the data from the queue so it might happen that one execution will “steal” the event for the other and vice versa. This PR changesnext
toaget
and adds asleep
to avoid that.