Tests: utils: lttng_pgrep spams output when racing with a process
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 20 Apr 2023 15:07:44 +0000 (11:07 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 20 Apr 2023 16:45:26 +0000 (12:45 -0400)
commit1098ec7b02bbfd71e0b84f79f86212173831652f
treeaf9811228c106874dab5a5d2c45217e59138ca13
parentffce811cff28f0c357c1edc2b06cf10d2cda21c4
Tests: utils: lttng_pgrep spams output when racing with a process

lttng_pgrep is often used to check if a process is alive. As such, it is
often used on PIDs which are tearing down.

The file redirection used in `tr '\0' '\n' < /proc/"$pid"/cmdline` often
fails (which is correct) because the /proc/$pid folder no longer exists.

When this occurs, the test output is cluttered with annoying errors like:
  ./tests/regression/kernel//../../utils/utils.sh: line 151: /proc/845/cmdline: No such file or directory

This part of the command now runs under a subshell to hide the error
when it occurs.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I6a26cb63cd56c46557a73e2e475b0cac729cc67f
tests/utils/utils.sh
This page took 0.026093 seconds and 4 git commands to generate.