From 686abe6a2f07fbfffafc2d27d3f63ee06db93dcd Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 25 Nov 2019 10:12:51 +0100 Subject: [PATCH] CI: ignore a non-fatal error in the loadable ELF file example --- .../hello_world/loadable_elf_example_test.py | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/examples/get-started/hello_world/loadable_elf_example_test.py b/examples/get-started/hello_world/loadable_elf_example_test.py index 61972d3652..c85dbd121b 100644 --- a/examples/get-started/hello_world/loadable_elf_example_test.py +++ b/examples/get-started/hello_world/loadable_elf_example_test.py @@ -34,14 +34,25 @@ class CustomProcess(object): class OCDProcess(CustomProcess): def __init__(self, proj_path): - cmd = 'openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg' + cmd = 'openocd -f board/esp32-wrover-kit-3.3v.cfg' log_file = os.path.join(proj_path, 'openocd.log') super(OCDProcess, self).__init__(cmd, log_file) - i = self.p.expect_exact(['Info : Listening on port 3333 for gdb connections', 'Error:']) - if i == 0: - Utility.console_log('openocd is listening for gdb connections') - else: - raise RuntimeError('openocd initialization has failed') + patterns = ['Info : Listening on port 3333 for gdb connections', + 'Error: type \'esp32\' is missing virt2phys'] + + try: + while True: + i = self.p.expect_exact(patterns, timeout=30) + # TIMEOUT or EOF exceptions will be thrown upon other errors + if i == 0: + Utility.console_log('openocd is listening for gdb connections') + break # success + elif i == 1: + Utility.console_log('Ignoring error: "{}"'.format(patterns[i])) + # this error message is ignored because it is not a fatal error + except Exception: + Utility.console_log('openocd initialization has failed', 'R') + raise def close(self): try: