mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
Merge branch 'selftests-net-fix-cmd-process-timeout-handling'
Gal Pressman says: ==================== selftests: net: fix cmd.process() timeout handling Pass the timeout argument correctly in cmd.process(). As Jakub noted, fixing the timeout broke the bpftrace() command in netpoll_basic.py, so fix it first. ==================== Link: https://patch.msgid.link/20260310115803.2521050-1-gal@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
87aa0f539d
|
|
@ -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()
|
||||
|
|
@ -258,8 +258,9 @@ def bpftrace(expr, json=None, ns=None, host=None, timeout=None):
|
|||
cmd_arr += ['-f', 'json', '-q']
|
||||
if timeout:
|
||||
expr += ' interval:s:' + str(timeout) + ' { exit(); }'
|
||||
timeout += 5
|
||||
cmd_arr += ['-e', expr]
|
||||
cmd_obj = cmd(cmd_arr, ns=ns, host=host, shell=False)
|
||||
cmd_obj = cmd(cmd_arr, ns=ns, host=host, shell=False, timeout=timeout)
|
||||
if json:
|
||||
# bpftrace prints objects as lines
|
||||
ret = {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user