test: utils: lttng_pgrep performs lookup on non-existing pid
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 30 Nov 2020 18:54:14 +0000 (13:54 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 1 Dec 2020 02:17:51 +0000 (21:17 -0500)
commit00d1ff64c4c7a19cd9e8bd705d76c5834d6dd822
treef7b68f10293fe6f5eda5d78127ec41bd17167443
parent8db3acaf0eb2b0032c2ba25b038d37d166933fa6
test: utils: lttng_pgrep performs lookup on non-existing pid

Observed issue
==============

 # Killing (signal SIGTERM) lttng-sessiond and lt-lttng-sessiond pids: 20962 20963
 ./tests/regression/tools/trigger/start-stop//../../../../utils/utils.sh: line 103: /proc/20963/cmdline: No such file or directory

Cause
=====

lttng_pgrep performs a two step search/validation for the pattern. Since
lttng_pgrep is used during tear-down of process (staged termination
signalling) a process returned by pgrep might exit before the second
check.

Solution
========

Simply silence the error. The code flow already acknowledges the
possibility of failure here.

Known drawbacks
=========

None

References
==========

Fixes: #1292

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I82cb9fd4754c10a5104af495a8a959f4fbd92664
tests/utils/utils.sh
This page took 0.032514 seconds and 4 git commands to generate.