Skip to content

nmci.process: format process timeout exception

Filip Pokryvka requested to merge fp/subprocess_timeout into main

Gather stdout and stderr of called process.

We should get some insight which command hanged here:

Traceback (most recent call last):
  File "features/environment.py", line 186, in _before_scenario
    tag.before_scenario(context, scenario)
  File "/mnt/tests/NetworkManager-ci/nmci/tags.py", line 48, in before_scenario
    self._before_scenario(context, scenario, **self.args)
  File "/mnt/tests/NetworkManager-ci/nmci/tags.py", line 1485, in prepare_patched_netdevsim_bs
    context.process.run_stdout(
  File "/mnt/tests/NetworkManager-ci/nmci/process.py", line 494, in run_stdout
    return self._run(
  File "/mnt/tests/NetworkManager-ci/nmci/process.py", line 320, in _run
    proc = subprocess.run(
  File "/usr/lib64/python3.9/subprocess.py", line 507, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/usr/lib64/python3.9/subprocess.py", line 1134, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/usr/lib64/python3.9/subprocess.py", line 1996, in _communicate
    self._check_timeout(endtime, orig_timeout, stdout, stderr)
  File "/usr/lib64/python3.9/subprocess.py", line 1178, in _check_timeout
    raise TimeoutExpired(
subprocess.TimeoutExpired: Command '['sh', 'prepare/netdevsim.sh', 'setup']' timed out after 599.9999559120006 seconds
HOOK-ERROR in after_scenario: AssertionError: killed externally (timeout)
Edited by Filip Pokryvka

Merge request reports

Loading