diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-07-31 14:35:59 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-07-31 14:35:59 +0200 |
commit | 41bcada133b7235db698a2354df27585438b6a4b (patch) | |
tree | 3a2dd43d321e40ef1f936e61235de325bd620b14 /tests/end2end/fixtures/quteprocess.py | |
parent | 1490135cb992fc4874fea8ba4cad7c054243fd31 (diff) | |
parent | 71ab96eb3ce3242a2863403943ce097230800cce (diff) | |
download | qutebrowser-41bcada133b7235db698a2354df27585438b6a4b.tar.gz qutebrowser-41bcada133b7235db698a2354df27585438b6a4b.zip |
Merge branch 'master' into pr/5457
Diffstat (limited to 'tests/end2end/fixtures/quteprocess.py')
-rw-r--r-- | tests/end2end/fixtures/quteprocess.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index c9fa140b0..eb71d5427 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -684,14 +684,17 @@ class QuteProc(testprocess.Process): if bad_msgs: text = 'Logged unexpected errors:\n\n' + '\n'.join( str(e) for e in bad_msgs) - # We'd like to use pytrace=False here but don't as a WORKAROUND - # for https://github.com/pytest-dev/pytest/issues/1316 - pytest.fail(text) + pytest.fail(text, pytrace=False) else: self._maybe_skip() finally: super().after_test() + def _wait_for_ipc(self): + """Wait for an IPC message to arrive.""" + self.wait_for(category='ipc', module='ipc', function='on_ready_read', + message='Read from socket *') + def send_ipc(self, commands, target_arg=''): """Send a raw command to the running IPC socket.""" delay = self.request.config.getoption('--qute-delay') @@ -699,8 +702,15 @@ class QuteProc(testprocess.Process): assert self._ipc_socket is not None ipc.send_to_running_instance(self._ipc_socket, commands, target_arg) - self.wait_for(category='ipc', module='ipc', function='on_ready_read', - message='Read from socket *') + + try: + self._wait_for_ipc() + except testprocess.WaitForTimeout: + # Sometimes IPC messages seem to get lost on Windows CI? + # Retry a second time as this shouldn't make tests fail. + ipc.send_to_running_instance(self._ipc_socket, commands, + target_arg) + self._wait_for_ipc() def start(self, *args, wait_focus=True, **kwargs): # pylint: disable=arguments-differ |