Skip to content

selftests/namespaces: Fix test hangs and false failures

Ricardo B. Marlière linux-kselftest lkml 1 version Applied

Status from this message: Applied to the vfs-7.2.misc branch of the vfs/vfs.git tree.

Get series with b4
b4 am [email protected] change-id 20260407-selftests-namespaces_fixes-43ff47179e5c

Versions newest first

  1. v1 Latest3 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3selftests/namespaces: Kill grandchild in nsid fixture teardowntools/testing/selftests/namespaces/nsid_test.c+13 -10 replies
2/3selftests/namespaces: Fix waitpid race in listns_efault_test cleanuptools/testing/selftests/namespaces/listns_efault_test.c+9 -60 replies
3/3selftests/namespaces: Skip efault tests when listns() is not availabletools/testing/selftests/namespaces/listns_efault_test.c+18 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] selftests/namespaces: Fix test hangs and false failures

This series addresses three reliability problems in the namespaces selftest suite that cause tests to hang or report incorrect results.

The first patch fixes a hang in nsid_test where the grandchild process is not reaped during fixture teardown, leaving it alive and holding the TAP pipe write-end open so the test runner blocks indefinitely waiting for EOF.

The second and third patches fix two problems in listns_efault_test: a waitpid(-1) race that can cause the iterator child to be consumed during namespace cleanup (leading to an indefinite block on the subsequent targeted waitpid), and a false FAIL verdict on kernels that do not implement listns() (the EFAULT tests should SKIP in that case, consistent with every other listns test that already handles ENOSYS correctly).

Assisted-by Claude Sonnet 4.6

---
Ricardo B. Marlière (3):
selftests/namespaces: Kill grandchild in nsid fixture teardown selftests/namespaces: Fix waitpid race in listns_efault_test cleanup selftests/namespaces: Skip efault tests when listns() is not available

 .../selftests/namespaces/listns_efault_test.c      | 33 ++++++++++++++++++----
 tools/testing/selftests/namespaces/nsid_test.c     | 14 ++++++++-
 2 files changed, 40 insertions(+), 7 deletions(-)

---
base-commit: bfe62a454542cfad3379f6ef5680b125f41e20f4
change-id: 20260407-selftests-namespaces_fixes-43ff47179e5c

Best regards,

Signature · 1 line
Ricardo B. Marlière <[email protected]>