summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-11-10 18:46:27 +0100
committerFlorian Bruhin <me@the-compiler.org>2020-11-25 18:02:31 +0100
commitd709f721a55d8b106623a6b84c5d928c3d08bb2a (patch)
tree8cd71332176383c42fcda51132932ccc506a9523
parent1f10b070d1d6942791d16c8f60fe10812804c0f8 (diff)
downloadqutebrowser-d709f721a55d8b106623a6b84c5d928c3d08bb2a.tar.gz
qutebrowser-d709f721a55d8b106623a6b84c5d928c3d08bb2a.zip
tests: Warn about processes which don't exit cleanly
(cherry picked from commit 3126ce6686137ae7d9e88dfa443692693f2f77d5)
-rw-r--r--pytest.ini1
-rw-r--r--tests/end2end/fixtures/testprocess.py6
2 files changed, 6 insertions, 1 deletions
diff --git a/pytest.ini b/pytest.ini
index 0b4fecf37..64a396513 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -82,4 +82,5 @@ filterwarnings =
error
# See https://github.com/HypothesisWorks/hypothesis/issues/2370
ignore:.*which is reset between function calls but not between test cases generated by:hypothesis.errors.HypothesisDeprecationWarning
+ default:Test process .* failed to terminate!:UserWarning
faulthandler_timeout = 90
diff --git a/tests/end2end/fixtures/testprocess.py b/tests/end2end/fixtures/testprocess.py
index 814d16806..85778c3e0 100644
--- a/tests/end2end/fixtures/testprocess.py
+++ b/tests/end2end/fixtures/testprocess.py
@@ -22,6 +22,7 @@
import re
import os
import time
+import warnings
import attr
import pytest
@@ -316,8 +317,11 @@ class Process(QObject):
else:
self.proc.terminate()
- ok = self.proc.waitForFinished()
+ ok = self.proc.waitForFinished(5000)
if not ok:
+ cmdline = ' '.join([self.proc.program()] + self.proc.arguments())
+ warnings.warn(f"Test process {cmdline} with PID {self.proc.processId()} "
+ "failed to terminate!")
self.proc.kill()
self.proc.waitForFinished()