Skip to content

Commit 128a280

Browse files
authored
OOM sub_test fix 'ps' line splitting to find child process (#28424)
I noticed in some failed runs that the output from `ps` puts two spaces between PID and PPID, but Python `split` is invoked with just a single space a separator, so the field indices are thrown off. Fixed by removing that separator arg to use the default of splitting on any length chunk of whitespace. [trivial fix, not reviewed]
2 parents 500bfed + 9871379 commit 128a280

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/compflags/oom/sub_test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ def kill_subphase(ppid):
7373
print(ps_output)
7474

7575
for line in ps_output.splitlines():
76-
split_line = line.split(" ")
77-
if str(ppid) in split_line[1]:
76+
split_line = line.split()
77+
if str(ppid) in split_line:
7878
child_pid = int(split_line[0])
7979
print(f"Killing subphase with PID {child_pid}...", end="")
8080
os.kill(child_pid, signal.SIGKILL)

0 commit comments

Comments
 (0)