Commit f0bd1931 authored by Gal Pressman's avatar Gal Pressman Committed by Jakub Kicinski
Browse files

selftests: net: fix timeout passed as positional argument to communicate()



The cited commit refactored the hardcoded timeout=5 into a parameter,
but dropped the keyword from the communicate() call.
Since Popen.communicate()'s first positional argument is 'input' (not
'timeout'), the timeout value is silently treated as stdin input and the
call never enforces a timeout.

Pass timeout as a keyword argument to restore the intended behavior.

Reviewed-by: default avatarNimrod Oren <noren@nvidia.com>
Signed-off-by: default avatarGal Pressman <gal@nvidia.com>
Link: https://patch.msgid.link/20260310115803.2521050-3-gal@nvidia.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 82562972
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ class cmd:
    def _process_terminate(self, terminate, timeout):
        if terminate:
            self.proc.terminate()
        stdout, stderr = self.proc.communicate(timeout)
        stdout, stderr = self.proc.communicate(timeout=timeout)
        self.stdout = stdout.decode("utf-8")
        self.stderr = stderr.decode("utf-8")
        self.proc.stdout.close()