On Feb 06, 2024 / 14:16, Daniel Wagner wrote: > When running the tests with FC as transport and the udev auto connect > enabled, discovery controllers are created and destroys while the tests Nit: maybe you meant "destroyed" or "destroy" instead of "destroys". > are running. This races with the cleanup code and also the > _find_nvme_dev() which iterates over all device entries and tries to > read the connect of transport and subsysnqn sysfs attributes. Since > these steps are not locked in anyway, the resources can go away in > between. > > Thus filter out 'cat' reporting non existing subsysnqn or transport > attributes. The tests will still fail if they can't fine the device etc. Nit: s/fine/find/ > But without filtering these errors out the tests fail randomly. > > Signed-off-by: Daniel Wagner <dwagner@xxxxxxx> > --- > tests/nvme/rc | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tests/nvme/rc b/tests/nvme/rc > index e0461f1cd53a..9cc83afe0668 100644 > --- a/tests/nvme/rc > +++ b/tests/nvme/rc > @@ -350,7 +350,7 @@ _cleanup_nvmet() { > > for dev in /sys/class/nvme/nvme*; do > dev="$(basename "$dev")" > - transport="$(cat "/sys/class/nvme/${dev}/transport")" > + transport="$(cat "/sys/class/nvme/${dev}/transport" 2>/dev/null)" > if [[ "$transport" == "${nvme_trtype}" ]]; then > echo "WARNING: Test did not clean up ${nvme_trtype} device: ${dev}" > _nvme_disconnect_ctrl "${dev}" > @@ -840,7 +840,7 @@ _find_nvme_dev() { > for dev in /sys/class/nvme/nvme*; do > [ -e "$dev" ] || continue > dev="$(basename "$dev")" > - subsysnqn="$(cat "/sys/class/nvme/${dev}/subsysnqn")" > + subsysnqn="$(cat "/sys/class/nvme/${dev}/subsysnqn" 2>/dev/null)" > if [[ "$subsysnqn" == "$subsys" ]]; then > echo "$dev" > fi > -- > 2.43.0 >