]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: net: fix timeout passed as positional argument to communicate()
authorGal Pressman <gal@nvidia.com>
Tue, 10 Mar 2026 11:58:03 +0000 (13:58 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 Mar 2026 02:11:40 +0000 (19:11 -0700)
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: Nimrod Oren <noren@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Link: https://patch.msgid.link/20260310115803.2521050-3-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/lib/py/utils.py

index a6d7fe15e6e40bb45615c234342cf237e08f6f10..17adc2b67ee098793d1d3c8f0b2e9f9e7c21bdaa 100644 (file)
@@ -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()