Merge pull request #8 in TM/task from ~UNODE/task:2.4.0 to 2.4.0
* commit '1f279ffde8e838a9cc34e2ebaa71200f0e0bb386': Unittest - Try to avoid racing conditions failures when capturing stdout/stderr
This commit is contained in:
@@ -62,12 +62,16 @@ def _get_output(proc, input):
|
|||||||
proc.send_signal(signal.SIGABRT)
|
proc.send_signal(signal.SIGABRT)
|
||||||
exit = wait_process(proc)
|
exit = wait_process(proc)
|
||||||
|
|
||||||
|
# NOTE Increase this value if tests fail with None being received as
|
||||||
|
# stdout/stderr instead of the expected content
|
||||||
|
timeout = 0.1 # seconds
|
||||||
|
|
||||||
try:
|
try:
|
||||||
out = outq.get_nowait()
|
out = outq.get(timeout=timeout)
|
||||||
except Empty:
|
except Empty:
|
||||||
out = None
|
out = None
|
||||||
try:
|
try:
|
||||||
err = errq.get_nowait()
|
err = errq.get(timeout=timeout)
|
||||||
except Empty:
|
except Empty:
|
||||||
err = None
|
err = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user