Skip to content

test_SfpStateUpdateTask_task_run_stop failed #369

@k-v1

Description

@k-v1

When I build master branch of sonic-buildimage (sonic-broadcom.bin) sometimes I get this error.

=================================== FAILURES ===================================
____________ TestXcvrdScript.test_SfpStateUpdateTask_task_run_stop _____________

self = <tests.test_xcvrd.TestXcvrdScript object at 0x7f11132cb0d0>

    @patch('xcvrd.xcvrd_utilities.port_mapping.subscribe_port_config_change', MagicMock(return_value=(None, None)))
    def test_SfpStateUpdateTask_task_run_stop(self):
        port_mapping = PortMapping()
        retry_eeprom_set = set()
        stop_event = threading.Event()
        sfp_error_event = threading.Event()
        task = SfpStateUpdateTask(DEFAULT_NAMESPACE, port_mapping, retry_eeprom_set, stop_event, sfp_error_event)
        task.start()
        assert wait_until(5, 1, task.is_alive)
        task.raise_exception()
>       task.join()

tests/test_xcvrd.py:1041: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
xcvrd/xcvrd.py:2177: in join
    raise self.exc
xcvrd/xcvrd.py:2152: in run
    self.task_worker(self.task_stopping_event, self.sfp_error_event)
xcvrd/xcvrd.py:1965: in task_worker
    port_mapping.handle_port_config_change(sel, asic_context, stopping_event, self.port_mapping, helper_logger, self.on_port_config_change)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

sel = None, asic_context = None
stop_event = <threading.Event object at 0x7f1113ccbc40>
port_mapping = <xcvrd.xcvrd_utilities.port_mapping.PortMapping object at 0x7f1113ccbcd0>
logger = <sonic_py_common.logger.Logger object at 0x7f1115fcf970>
port_change_event_handler = <bound method SfpStateUpdateTask.on_port_config_change of <SfpStateUpdateTask(SfpStateUpdateTask, stopped 139711322162944)>>

    def handle_port_config_change(sel, asic_context, stop_event, port_mapping, logger, port_change_event_handler):
        """Select CONFIG_DB PORT table changes, once there is a port configuration add/remove, notify observers
        """
        if not stop_event.is_set():
>           (state, _) = sel.select(SELECT_TIMEOUT_MSECS)
E           AttributeError: 'NoneType' object has no attribute 'select'

xcvrd/xcvrd_utilities/port_mapping.py:218: AttributeError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions