Lines Matching +full:poll +full:- +full:timeout +full:- +full:ms
4 # Copyright (c) 2018-2022 Intel Corporation
8 # SPDX-License-Identifier: Apache-2.0
39 print("Install pyserial python module with pip to use --device-testing option.")
45 pass # "--device-serial-pty" option is not supported on Windows OS
99 return math.ceil(self.instance.testsuite.timeout *
123 _d_suite = detected_suite_names[-len(expected_suite_names):]
219 this_timeout = timeout_time - time.time()
226 line_decoded = self.line.decode('utf-8', "replace")
229 stripped_line = stripped_line[:-len(suffix)].rstrip()
249 # so let's give it up to 100ms to do so
271 command = ["renode-test",
272 "--variable", "KEYWORDS:" + keywords,
273 "--variable", "ELF:@" + elf,
274 "--variable", "RESC:@" + resc,
275 "--variable", "UART:" + uart]
282 command = [self.generator_cmd, "-C", self.get_default_domain_build_dir(), target]
291 command = ["valgrind", "--error-exitcode=2",
292 "--leak-check=full",
293 "--suppressions=" + ZEPHYR_BASE + "/scripts/valgrind.supp",
294 "--log-file=" + self.build_dir + "/valgrind.log",
295 "--track-origins=yes",
300 command.append(f"--seed={self.seed}")
338 self.instance.reason = "Timeout"
339 self.instance.add_missing_case_status(TwisterStatus.BLOCK, "Timeout")
376 handler_time = time.time() - start_time
412 timeout = super().get_test_timeout()
415 timeout += 120
416 return timeout
467 for sl in serial_line.decode('utf-8', 'ignore').splitlines(keepends=True):
468 log_out_fp.write(strip_ansi_sequences(sl).encode('utf-8'))
534 def run_custom_script(script, timeout): argument
537 stdout, stderr = proc.communicate(timeout=timeout)
549 command = ["west", "flash", "--skip-rebuild", "-d", self.build_dir]
553 # 1) bare: --west-flash
555 # 2) with a value: --west-flash="--board-id=42"
556 # This results in options.west_flash == "--board-id=42"
557 # 3) Multiple values: --west-flash="--board-id=42,--erase"
558 # This results in options.west_flash == "--board-id=42 --erase"
563 command.append("--runner")
571 command_extra_args.append("--dev-id")
574 command_extra_args.append("--esp-device")
580 and product == "STLINK-V3"
582 command_extra_args.append("--cmd-pre-init")
584 elif runner == "openocd" and product == "EDBG CMSIS-DAP":
585 command_extra_args.append("--cmd-pre-init")
587 elif runner == "openocd" and product == "LPC-LINK2 CMSIS-DAP":
588 command_extra_args.append("--cmd-pre-init")
591 command.append("--dev-id")
595 # --probe=#<number> select by probe index
596 # --probe=<serial number> select by probe serial number
597 command.append(f"--probe={board_id}")
599 command.append(f"--tool-opt=sn={board_id}")
607 command.append('--')
610 command = [self.generator_cmd, "-C", self.build_dir, "flash"]
623 self.instance.reason = "Timeout"
629 logger.debug(f"Terminating serial-pty:'{ser_pty}'")
632 (stdout, stderr) = ser_pty_process.communicate(timeout=self.get_test_timeout())
633 logger.debug(f"Terminated serial-pty:'{ser_pty}', stdout:'{stdout}', stderr:'{stderr}'")
635 logger.debug(f"Terminated serial-pty:'{ser_pty}'")
648 timeout=max(flash_timeout, self.get_test_timeout())
732 timeout = 30
734 timeout = script_param.get("pre_script_timeout", timeout)
735 self.run_custom_script(pre_script, timeout)
771 (stdout, stderr) = proc.communicate(timeout=flash_timeout)
787 self.instance.reason = "Device issue (Timeout)"
800 timeout = 30
802 timeout = script_param.get("post_flash_timeout", timeout)
803 self.run_custom_script(post_flash_script, timeout)
816 # Always wait at most the test timeout here after flashing.
837 handler_time = time.time() - start_time
844 timeout = 30
846 timeout = script_param.get("post_script_timeout", timeout)
847 self.run_custom_script(post_script, timeout)
875 self.fifo_fn = os.path.join(instance.build_dir, "qemu-fifo")
919 def _thread(handler, timeout, outdir, logfile, fifo_fn, pid_fn, argument
936 # want read() or poll() to ever block if there is data in there
941 timeout_time = start_time + timeout
942 p = select.poll()
956 this_timeout = int((timeout_time - time.time()) * 1000)
958 # Quit early after timeout extension if no more data is being received
960 if this_timeout < 0 or not p.poll(this_timeout):
965 # QEMU process during p.poll(this_timeout)
967 if cpu_time < timeout and _status == TwisterStatus.NONE:
968 timeout_time = time.time() + (timeout - cpu_time)
979 _reason = "timeout"
987 c = in_fp.read(1).decode("utf-8")
1020 # the timeout and wait for 2 more seconds to catch anything
1032 handler_time = time.time() - start_time
1040 # Oh well, as long as it's dead! User probably sent Ctrl-C
1051 self.fifo_fn = os.path.join(self.instance.build_dir, "qemu-fifo")
1062 command += ["-C", sysbuild_build_dir, "run"]
1071 self.instance.reason = "Timeout"
1117 # in that case kill -9 QEMU process directly and leave
1130 logger.debug(f"No timeout, return code from QEMU ({qemu_pid}): {proc.returncode}")
1135 self.thread.join(max(thread_max_time - time.time(), 0))
1178 self.fifo_fn = os.path.join(instance.build_dir, "qemu-fifo")
1218 # Oh well, as long as it's dead! User probably sent Ctrl-C
1243 command += ["-C", sysbuild_build_dir, "run"]
1252 self.instance.reason = "Timeout"
1278 timeout, argument
1285 timeout_time = start_time + timeout
1295 this_timeout = int((timeout_time - time.time()) * 1000)
1301 # QEMU process during p.poll(this_timeout)
1303 if cpu_time < timeout and _status == TwisterStatus.NONE:
1304 timeout_time = time.time() + (timeout - cpu_time)
1315 _reason = "timeout"
1331 c = c.decode("utf-8")
1364 # the timeout and wait for 2 more seconds to catch anything
1378 handler_time = time.time() - start_time
1411 if (thread_max_time - time.time()) < 0: