fix(api): make hs wait until idle on deactivate shake
Closes RSS-66
Overview
The above issue seems to be a race condition where hardware control internal state sometimes doesn't update before by the next awaited poll. So this PR adds a wait until h/s state updates to reflect IDLE state.
Changelog
- added
_wait_for_shake_deactivation
Review requests
I wasn't able to repro the original issue but as long as this fix doesn't cause any existing functionality to fail, and we don't get the above error with the fix, I think we should be okay to call it fixed.
Here's a protocol for testing:
import time
metadata = {
'protocolName': 'Heater-shaker race condition checker',
'author': 'Opentrons <[email protected]>',
'apiLevel': '2.13'
}
def run(context):
p10rack = [context.load_labware('opentrons_96_tiprack_10ul', '5')]
p20 = context.load_instrument('p20_single_gen2', 'right',
tip_racks= p10rack)
# Load Heater-shaker module
hs_mod = context.load_module("heaterShakerModuleV1", 1)
# Load adapter + labware on module.
hs_plate = hs_mod.load_labware("opentrons_96_flat_bottom_adapter_nest_wellplate_200ul_flat")
other_plate = context.load_labware("biorad_96_wellplate_200ul_pcr", 11)
reservoir = context.load_labware('usascientific_12_reservoir_22ml', 7)
p20.pick_up_tip()
for x in range(10):
hs_mod.close_labware_latch()
hs_mod.set_and_wait_for_shake_speed(rpm=300) # Waits until H/S has reached 300rpm speed. Should retract pipettes before
context.delay(seconds=5)
hs_mod.deactivate_shaker()
hs_mod.open_labware_latch()
Risk assessment
Low if QA H/S protocols work as expected.
Codecov Report
Merging #11342 (b9a2157) into release_6.1.0 (b3d533c) will increase coverage by
0.22%. The diff coverage isn/a.
@@ Coverage Diff @@
## release_6.1.0 #11342 +/- ##
=================================================
+ Coverage 71.87% 72.10% +0.22%
=================================================
Files 1048 1065 +17
Lines 17151 17382 +231
Branches 3710 3710
=================================================
+ Hits 12328 12534 +206
- Misses 3857 3882 +25
Partials 966 966
| Flag | Coverage Δ | |
|---|---|---|
| notify-server | 89.17% <ø> (?) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| notify-server/notify_server/clients/serdes.py | 90.90% <0.00%> (ø) |
|
| notify-server/notify_server/models/topics.py | 0.00% <0.00%> (ø) |
|
| notify-server/notify_server/app_sub.py | 0.00% <0.00%> (ø) |
|
| ...er/notify_server/models/hardware_event/__init__.py | 100.00% <0.00%> (ø) |
|
| notify-server/notify_server/logging.py | 85.71% <0.00%> (ø) |
|
| notify-server/notify_server/network/connection.py | 100.00% <0.00%> (ø) |
|
| ...erver/notify_server/models/hardware_event/names.py | 100.00% <0.00%> (ø) |
|
| notify-server/notify_server/clients/subscriber.py | 90.00% <0.00%> (ø) |
|
| notify-server/notify_server/__init__.py | 100.00% <0.00%> (ø) |
|
| notify-server/notify_server/server/__init__.py | 100.00% <0.00%> (ø) |
|
| ... and 7 more |
Tested on a heater-shaker w/ above protocol.