Skip to content

Bug: [dualtor][faulty y-cable] UnboundLocalError: 'y_cable_simulated_path' referenced before assignment #21946

@pdam-arista

Description

@pdam-arista

Is it platform specific

generic

Importance or Severity

Medium

Description of the bug

Multiple tests in dualtor/test_switchover_faulty_ycable.py failed as searching for the file y_cable_simulated.py in the container pmon resulted in find getting warnings like

_"find: '/proc/153727': No such file or directory find: '/proc/153728': No such file or directory"_

These are the short lived process started by xcvrd in the form of some polling which are exiting and appearing as warning when find / command is run

/bin/sh -c sonic-db-cli STATE_DB hget "FAST_RESTART_ENABLE_TABLE|system" enable  
sonic-db-cli STATE_DB hget FAST_RESTART_ENABLE_TABLE|system enable

This occurs in
https://github.com/sonic-net/sonic-mgmt/blob/202511/tests/dualtor/test_switchover_faulty_ycable.py#L60

Steps to Reproduce

Run tests in dualtor/test_switchover_faulty_ycable.py

Actual Behavior and Expected Behavior

Actual Behaviour

find_path_res = duthost.shell("docker exec pmon find / -name y_cable_simulated.py")["stdout"]
gives

/usr/local/lib/python3.11/dist-packages/sonic_y_cable/microsoft/y_cable_simulated.py
find: '/proc/153727': No such file or directory
find: '/proc/153728': No such file or directory

Expected Behaviour
find_path_res = duthost.shell("docker exec pmon find / -name y_cable_simulated.py")["stdout"]
gives

/usr/local/lib/python3.11/dist-packages/sonic_y_cable/microsoft/y_cable_simulated.py

Relevant log output

Command:
docker exec pmon find / -name y_cable_simulated.py

Ansible result:
rc = 1
failed = True
changed = True
msg = non-zero return code

/usr/local/lib/python3.11/dist-packages/sonic_y_cable/microsoft/y_cable_simulated.py
find: '/proc/153727': No such file or directory
find: '/proc/153728': No such file or directory

Output of show version

SONiC Software Version: SONiC.branch.202511-ars.b83a7149-buildimage.origin.202511-nightly-2026.01.08.03.51
SONiC OS Version: 12

Attach files (if any)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions