diff mbox series

[v2,1/3] test-runner: allow infinite process wait

Message ID 20220719185223.456197-1-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [v2,1/3] test-runner: allow infinite process wait | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-alpine-ci-fetch success Fetch PR
prestwoj/iwd-ci-gitlint success GitLint
prestwoj/iwd-ci-fetch success Fetch PR
prestwoj/iwd-ci-makedistcheck success Make Distcheck
prestwoj/iwd-ci-build success Build - Configure
prestwoj/iwd-alpine-ci-makedistcheck success Make Distcheck
prestwoj/iwd-alpine-ci-build success Build - Configure
prestwoj/iwd-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-ci-clang success clang PASS
prestwoj/iwd-ci-makecheck success Make Check
prestwoj/iwd-alpine-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-alpine-ci-makecheck success Make Check
prestwoj/iwd-ci-incremental_build success Incremental Build with patches
prestwoj/iwd-alpine-ci-incremental_build success Incremental Build with patches
prestwoj/iwd-ci-testrunner success test-runner PASS

Commit Message

James Prestwood July 19, 2022, 6:52 p.m. UTC
subprocess.Popen's wait() method was overwritten to be non-blocking but
in certain circumstances you do want to wait forever. Fix this to allow
timeout=None, which calls the parent wait() method directly.
---
 tools/utils.py | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Denis Kenzior July 19, 2022, 7:33 p.m. UTC | #1
Hi James,

On 7/19/22 13:52, James Prestwood wrote:
> subprocess.Popen's wait() method was overwritten to be non-blocking but
> in certain circumstances you do want to wait forever. Fix this to allow
> timeout=None, which calls the parent wait() method directly.
> ---
>   tools/utils.py | 4 ++++
>   1 file changed, 4 insertions(+)
> 

All applied, thanks.

Regards,
-Denis
diff mbox series

Patch

diff --git a/tools/utils.py b/tools/utils.py
index bc030230..7a182848 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -246,6 +246,10 @@  class Process(subprocess.Popen):
 
 	# Override wait() so it can do so non-blocking
 	def wait(self, timeout=10):
+		if timeout == None:
+			super().wait()
+			return
+
 		Namespace.non_block_wait(self.__wait, timeout, 1)
 		self._cleanup()