Skip to content

samples: samples/sensor/sensor_shell: frdm_imxrt1186/mimxrt1186/cm7: failed: 1/5 pytest scenario(s) failed #2233

@hakehuang

Description

@hakehuang

Describe the bug
below case are failed
sample.sensor.shell.pytest.test_sensor_shell_get

test is failed on v4.4.0-3846-g74a32bdff3ca on frdm_imxrt1186/mimxrt1186/cm7
testcase path is samples/sensor/sensor_shell

see logs for details

To Reproduce
1.

scripts/twister -p frdm_imxrt1186/mimxrt1186/cm7  -T samples/sensor/sensor_shell -s sample.sensor.shell.pytest

or

# west twister -p frdm_imxrt1186/mimxrt1186/cm7 -T samples/sensor/sensor_shell -s sample.sensor.shell.pytest
  1. See error
1/5 pytest scenario(s) failed
AssertionError: Did not find line "uart:\~\$\ " within 20.0 seconds

Expected behavior
test pass

Impact

Logs and console output

shell = <twister_harness.helpers.shell.Shell object at 0x7fedb617b800>

    def test_sensor_shell_get(shell: Shell):
        logger.info('get "sensor get" command count')
    
>       lines = shell.exec_command('sensor get sensor@0')
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

../../zephyr/samples/sensor/sensor_shell/pytest/test_sensor_shell.py:25: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../zephyr/scripts/pylib/pytest-twister-harness/src/twister_harness/helpers/shell.py:91: in exec_command
    self._device.readlines_until(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <twister_harness.device.hardware_adapter.HardwareAdapter object at 0x7fedb3d02480>
connection_index = 0
kwargs = {'print_output': True, 'regex': 'uart:\\~\\$\\ ', 'timeout': 20.0}

    def readlines_until(self, connection_index: int = 0, **kwargs) -> list[str]:
        """Read lines from device output until a specific condition is met.
    
        This method provides flexible ways to collect device output: wait for a specific
        pattern, collect a fixed number of lines, or get all currently available lines.
    
        :param connection_index: Index of the connection/port to read from (default: 0).
            For hardware devices: 0 = main UART, 1 = second core UART, etc.
            For QEMU and native: always use 0 (only one connection available)
        :param kwargs: Keyword arguments passed to underlying connection including:
    
            - regex - Regular expression pattern to search for
            - num_of_lines - Exact number of lines to read
            - timeout - Maximum time in seconds to wait (uses base_timeout if not provided)
            - print_output - Whether to log each line as it's read (default: True)
        :returns: List of output lines without trailing newlines
        :raises AssertionError: If timeout expires before condition is met
        """
        self.check_connection(connection_index)
>       return self.connections[connection_index].readlines_until(**kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       AssertionError: Did not find line "uart:\~\$\ " within 20.0 seconds

../../zephyr/scripts/pylib/pytest-twister-harness/src/twister_harness/device/device_adapter.py:133: AssertionError
    


Environment (please complete the following information):

  • OS: (e.g. Linux ): Linux
  • Toolchain (e.g Zephyr SDK): zephyr/gnu
  • Commit SHA or Version used: v4.4.0-3846-g74a32bdff3ca

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions