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

fix(api): OT-2 attempting to connect modules via temporary ports #15134

Conversation

sanni-t
Copy link
Member

@sanni-t sanni-t commented May 8, 2024

Closes AUTH-379

Overview

#14345 updated the module ports filtering to exclude any temporary ports created by udev. But the regex used for port name matching filters out only Flex port names (e.g. ot_module_thermocycler2.tmp-c166:2). This PR adds regex to filter out OT-2 temp ports as well (e.g. .#ot_module_thermocycler0b494617b5e4f08ae).

Test Plan

Before this PR, when you connect a module on the OT-2, you should see something like the following in the logs (doesn't affect actual module connectivity):

Module Added: ModuleAtPort(port='/dev/.#ot_module_thermocycler0b494617b5e4f08ae', name='thermocycler', usb_port=USBPort(name='', port_number=0, port_group='unknown', hub=False, hub_port=None, device_path=''))
Exception in Module registration
           Traceback (most recent call last):
             File "/usr/lib/python3.10/site-packages/serial/serialposix.py", line 322, in open
           FileNotFoundError: [Errno 2] No such file or directory: '/dev/.#ot_module_thermocycler0b494617b5e4f08ae'

With the changes in this PR, this error should never happen and the module should get connected correctly over its expected port.

Test that Flex modules' connectivity isn't affected by this either.

Review requests

I'm still new to regex and looks like there are a few ways to write the pattern to filter out the temp port names. So let me know if there's a better regex pattern for this.

Risk assessment

Medium. Can affect module connectivity but is easy to test and rule out any issues.

@sanni-t sanni-t requested a review from sfoster1 May 8, 2024 20:46
@sanni-t sanni-t requested a review from a team as a code owner May 8, 2024 20:46
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wyhyyyy is it like this

@sanni-t sanni-t merged commit 2011402 into chore_release-7.3.0 May 8, 2024
20 checks passed
@sanni-t sanni-t deleted the AUTH-379-ot-2-attempting-to-connect-modules-via-temporary-ports branch May 9, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants