test attachp with inexistent pid: add timeout proper handling

pull/1032/head
disconnect3d 3 years ago
parent dbd55e650f
commit a53abc8376

@ -89,6 +89,12 @@ def test_attachp_command_nonexistent_procname():
def test_attachp_command_no_pids():
result = run_gdb_with_script(pyafter='attachp 99999999', timeout=5) # No chance there is a PID like this
try:
# On some machines/GDB versions this halts/waits forever, so we add a timeout here
result = run_gdb_with_script(pyafter='attachp 99999999', timeout=5) # No chance there is a PID like this
except subprocess.TimeoutExpired:
# Assume it works
return
assert 'Error: ptrace: No such process.' in result

Loading…
Cancel
Save