mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] testing: avoid error on test failure / abort
It's not entirely clear but I assume if / when a test fails or is aborted (via C-c) pytest kills the stdout somehow. Either way this causes a bunch of `OSError` to be logged out as we try to write to closed pipes. If that occurs, assume the test is gone and just bail out of the thread.
This commit is contained in:
parent
d5bda3d3e2
commit
5dcdfb1138
@ -1,6 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import errno
|
||||||
import select
|
import select
|
||||||
import shutil
|
import shutil
|
||||||
import threading
|
import threading
|
||||||
@ -515,7 +516,12 @@ def server(request, db, port, module, addons_path, tmpdir):
|
|||||||
r = os.read(inpt, 4096)
|
r = os.read(inpt, 4096)
|
||||||
if not r:
|
if not r:
|
||||||
break
|
break
|
||||||
os.write(output, r)
|
try:
|
||||||
|
os.write(output, r)
|
||||||
|
except OSError as e:
|
||||||
|
if e.errno == errno.EBADF:
|
||||||
|
break
|
||||||
|
raise
|
||||||
buf.extend(r)
|
buf.extend(r)
|
||||||
os.close(inpt)
|
os.close(inpt)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user