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

tests(cpu): Add deep sleep and misc tests for CPU #10112

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

fix

47a1329
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Draft

tests(cpu): Add deep sleep and misc tests for CPU #10112

fix
47a1329
Select commit
Loading
Failed to load commit list.
GitHub Actions / Test Results failed Oct 1, 2024 in 0s

1 fail, 21 pass in 26m 46s

100 files   - 24  100 suites   - 24   26m 46s ⏱️ - 4m 6s
 22 tests  -  5   21 ✅  -  5  0 💤 ±0  1 ❌ ±0 
258 runs   - 30  254 ✅  - 29  0 💤 ±0  4 ❌  - 1 

Results for commit 47a1329. ± Comparison against earlier commit 068b212.

Annotations

Check warning on line 0 in validation.sleep.test_sleep

See this annotation in the file changed.

@github-actions github-actions / Test Results

4 out of 6 runs failed: test_sleep (validation.sleep.test_sleep)

./artifacts/parent-artifacts/results/hw/validation/sleep/esp32c3/sleep.xml [took 52s]
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32c6/sleep.xml [took 56s]
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32h2/sleep.xml [took 51s]
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32s3/sleep.xml [took 57s]
Raw output
pexpect.exceptions.TIMEOUT: Not found "Woke up from light sleep"
Bytes in current buffer (color code eliminated): FAIL
Please check the full log here: /tmp/pytest-embedded/2024-10-01_02-34-35-172086/test_sleep/dut.log
self = <pytest_embedded_serial.dut.SerialDut object at 0x7f88c6bbd1b0>
pattern = 'Woke up from light sleep', expect_all = False, not_matching = ()
args = (), kwargs = {}, patterns = ['Woke up from light sleep'], res = []
debug_str = 'Not found "Woke up from light sleep"\nBytes in current buffer (color code eliminated): FAIL\nPlease check the full log here: /tmp/pytest-embedded/2024-10-01_02-34-35-172086/test_sleep/dut.log'

    @functools.wraps(func)
    def wrapper(
        self, pattern, *args, expect_all: bool = False, not_matching: List[Union[str, re.Pattern]] = (), **kwargs
    ) -> Union[Union[Match, AnyStr], List[Union[Match, AnyStr]]]:
        patterns = to_list(pattern)
        res = []
        while patterns:
            try:
>               index = func(self, pattern, *args, **kwargs)

/usr/local/lib/python3.10/site-packages/pytest_embedded/dut.py:76: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut.py:153: in expect_exact
    return self.pexpect_proc.expect_exact(pattern, **kwargs)
/usr/local/lib/python3.10/site-packages/pexpect/spawnbase.py:432: in expect_exact
    return exp.expect_loop(timeout)
/usr/local/lib/python3.10/site-packages/pexpect/expect.py:181: in expect_loop
    return self.timeout(e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pexpect.expect.Expecter object at 0x7f88c68c18a0>
err = TIMEOUT("<pytest_embedded.log.PexpectProcess object at 0x7f88c6bbcc40>\nsearcher: searcher_string:\n    0: b'Woke up from light sleep'")

    def timeout(self, err=None):
        spawn = self.spawn
    
        spawn.before = spawn._before.getvalue()
        spawn.after = TIMEOUT
        index = self.searcher.timeout_index
        if index >= 0:
            spawn.match = TIMEOUT
            spawn.match_index = index
            return index
        else:
            spawn.match = None
            spawn.match_index = None
            msg = str(spawn)
            msg += '\nsearcher: %s' % self.searcher
            if err is not None:
                msg = str(err) + '\n' + msg
    
            exc = TIMEOUT(msg)
            exc.__cause__ = None    # in Python 3.x we can use "raise exc from None"
>           raise exc
E           pexpect.exceptions.TIMEOUT: <pytest_embedded.log.PexpectProcess object at 0x7f88c6bbcc40>
E           searcher: searcher_string:
E               0: b'Woke up from light sleep'
E           <pytest_embedded.log.PexpectProcess object at 0x7f88c6bbcc40>
E           searcher: searcher_string:
E               0: b'Woke up from light sleep'

/usr/local/lib/python3.10/site-packages/pexpect/expect.py:144: TIMEOUT

The above exception was the direct cause of the following exception:

dut = <pytest_embedded_serial.dut.SerialDut object at 0x7f88c6bbd1b0>

    def test_sleep(dut):
        LOGGER = logging.getLogger(__name__)
    
        # Deep Sleep
        boot_count = 1
        dut.expect_exact("Boot number: {}".format(boot_count))
        dut.expect_exact("Wakeup reason: power_up")
    
        for capability, devices in capabilities.items():
            if dut.app.target in devices and capability != "uart":
                LOGGER.info("Testing {} deep sleep capability".format(capability))
                boot_count += 1
                dut.write("{}_deep".format(capability))
                dut.expect_exact("Boot number: {}".format(boot_count))
                dut.expect_exact("Wakeup reason: {}".format(capability))
    
        # Light Sleep
        for capability, devices in capabilities.items():
            if dut.app.target in devices:
                LOGGER.info("Testing {} light sleep capability".format(capability))
                dut.write("{}_light".format(capability))
                if capability == "uart":
                    time.sleep(5)
                    LOGGER.info("Sending 9 positive edges")
                    dut.write("aaa") # Send 9 positive edges
                dut.expect_exact("Woke up from light sleep")
                dut.expect_exact("Wakeup reason: {}".format(capability))
                if capability == "timer":
                    LOGGER.info("Testing timer light sleep capability with low frequency")
                    dut.write("timer_freq_light")
>                   dut.expect_exact("Woke up from light sleep")

tests/validation/sleep/test_sleep.py:40: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_embedded_serial.dut.SerialDut object at 0x7f88c6bbd1b0>
pattern = 'Woke up from light sleep', expect_all = False, not_matching = ()
args = (), kwargs = {}, patterns = ['Woke up from light sleep'], res = []
debug_str = 'Not found "Woke up from light sleep"\nBytes in current buffer (color code eliminated): FAIL\nPlease check the full log here: /tmp/pytest-embedded/2024-10-01_02-34-35-172086/test_sleep/dut.log'

    @functools.wraps(func)
    def wrapper(
        self, pattern, *args, expect_all: bool = False, not_matching: List[Union[str, re.Pattern]] = (), **kwargs
    ) -> Union[Union[Match, AnyStr], List[Union[Match, AnyStr]]]:
        patterns = to_list(pattern)
        res = []
        while patterns:
            try:
                index = func(self, pattern, *args, **kwargs)
            except (pexpect.EOF, pexpect.TIMEOUT) as e:
                debug_str = (
                    f'Not found "{pattern!s}"\n'
                    f'Bytes in current buffer (color code eliminated): {self.pexpect_proc.buffer_debug_str}\n'
                    f'Please check the full log here: {self.logfile}'
                )
>               raise e.__class__(debug_str) from e
E               pexpect.exceptions.TIMEOUT: Not found "Woke up from light sleep"
E               Bytes in current buffer (color code eliminated): FAIL
E               Please check the full log here: /tmp/pytest-embedded/2024-10-01_02-34-35-172086/test_sleep/dut.log

/usr/local/lib/python3.10/site-packages/pytest_embedded/dut.py:83: TIMEOUT

Check notice on line 0 in .github

See this annotation in the file changed.

@github-actions github-actions / Test Results

22 tests found

There are 22 tests, see "Raw output" for the full list of tests.
Raw output
auto_baudrate_test
basic_transmission_test
begin_when_running_test
change_baudrate_test
change_cpu_frequency_test
change_pins_test
disabled_uart_calls_test
enabled_uart_calls_test
end_when_stopped_test
get_cpu_temperature
periman_test
resize_buffers_test
test_fail
test_pass
timer_clock_select_test
timer_divider_test
timer_interrupt_test
timer_read_test
validation.hello_world.test_hello_world ‑ test_hello_world
validation.nvs.test_nvs ‑ test_nvs
validation.periman.test_periman ‑ test_periman
validation.sleep.test_sleep ‑ test_sleep