summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2023-08-10 13:23:33 +0200
committerFlorian Bruhin <me@the-compiler.org>2023-08-10 13:25:26 +0200
commit9e21e2e86bee5b0de42fe28153dd1bcb0aa51d27 (patch)
treed51f5e8afd0abd5fdbfe8451588217ac83e2daf7
parent3b1c3856a95da66cb7667455c320d89f4c9d20df (diff)
downloadqutebrowser-9e21e2e86bee5b0de42fe28153dd1bcb0aa51d27.tar.gz
qutebrowser-9e21e2e86bee5b0de42fe28153dd1bcb0aa51d27.zip
tests: Handle PermissionError for waitpid in test_restart
While not documented that way: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/cwait?view=msvc-170 It looks like that Windows sometimes sets errno to EACCES here (causing a PermissionError): > os.waitpid(pid, 0) # pid, options... positional-only :( E PermissionError: [Errno 13] Permission denied I have no idea why it happens, but it results in flaky tests on CI. We aren't particularly interested in this (we just want to make sure the process is cleaned up before the next test runs...), so let's just ignore this.
-rw-r--r--tests/end2end/test_invocations.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py
index e31aa3ecb..af81781f6 100644
--- a/tests/end2end/test_invocations.py
+++ b/tests/end2end/test_invocations.py
@@ -937,6 +937,7 @@ def test_restart(request, quteproc_new):
# If the new process hangs, this will hang too.
# Still better than just ignoring it, so we can fix it if something is broken.
os.waitpid(pid, 0) # pid, options... positional-only :(
- except ChildProcessError:
- # Already gone
+ except (ChildProcessError, PermissionError):
+ # Already gone. Even if not documented, Windows seems to raise PermissionError
+ # here...
pass