[PATCH 0/2] Disable tests failing due to YAMA’s ptrace_scope.

  • Done
  • quality assurance status badge
Details
2 participants
  • Lars-Dominik Braun
  • Maxime Devos
Owner
unassigned
Submitted by
Lars-Dominik Braun
Severity
normal
L
L
Lars-Dominik Braun wrote on 9 Jun 2022 10:51
[PATCH 0/2] Disable tests failin g due to YAMA’s ptrace_scope.
(address . guix-patches@gnu.org)
cover.1654763934.git.lars@6xq.net
Hi,

I noticed that some tests fail on my foreign distribution,
but not on Guix System, because they differ in their
/proc/sys/kernel/yama/ptrace_scope. Guix sets it to 0 (no limitations),
whereas most distributions default to 1 (only children can be ptrace’d),
causing a reproducibility issue. The following patches therefore disable
tests, which fail with a setting of >0.

Cheers,
Lars

Lars-Dominik Braun (2):
gnu: python-pydevd: Skip tests failing due to YAMA.
gnu: python-debugpy: Disable tests.

gnu/packages/python-xyz.scm | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)

--
2.35.1
L
L
Lars-Dominik Braun wrote on 9 Jun 2022 11:04
[PATCH 1/2] gnu: python-pydevd: Skip tests failing due to YAMA.
(address . 55866@debbugs.gnu.org)
558bc49a6dba232a5b4bc797b4a034d2e3baf142.1654765434.git.lars@6xq.net
* gnu/packages/python-xyz.scm (python-pydevd)[arguments]: Add skipped
tests.
---
gnu/packages/python-xyz.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

Toggle diff (18 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5f9ce4fdfe..8de8d571e4 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -12351,7 +12351,10 @@ (define-public python-pydevd
;; This test validates that 'pydevd' is not in the
;; exception message, but it is due to being part
;; of the build file name present in the message.
- "and not test_evaluate_exception_trace")))))
+ "and not test_evaluate_exception_trace "
+ ;; These fail on systems with YAMA LSM’s ptrace
+ ;; scope > 0.
+ "and not test_attach_to_pid")))))
(add-after 'install 'install-attach-binary
(lambda _
(install-file "attach.so"
--
2.35.1
L
L
Lars-Dominik Braun wrote on 9 Jun 2022 11:04
[PATCH 2/2] gnu: python-debugpy: Disable tests.
(address . 55866@debbugs.gnu.org)
a0941d5f912577daed2d23c36deccbc55f134208.1654765434.git.lars@6xq.net
* gnu/packages/python-xyz.scm (python-debugpy)[arguments]: Respect
tests? in 'check phase and disable #:tests.
---
gnu/packages/python-xyz.scm | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)

Toggle diff (44 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 8de8d571e4..8e79ea01ae 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -12399,6 +12399,7 @@ (define-public python-debugpy
(build-system python-build-system)
(arguments
(list
+ #:tests? #f ; Fail on systems with YAMA LSM’s ptrace scope > 0.
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'patch-sh-in-tests
@@ -12419,17 +12420,18 @@ (define-public python-debugpy
(setenv "DEBUGPY_BUNDLING_DISABLED" "1")))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
- (invoke "pytest" "-vv"
- "-n" (number->string (parallel-job-count))
- "-k"
- (string-append
- ;; These tests cannot be run in parallel because their
- ;; test data would not be copied by xdist and lead to
- ;; import errors. (see:
- ;; https://github.com/microsoft/debugpy/issues/342 and
- ;; https://github.com/microsoft/debugpy/issues/880).
- "not test_custom_python_args "
- "and not test_autokill ")))))))
+ (when tests?
+ (invoke "pytest" "-vv"
+ "-n" (number->string (parallel-job-count))
+ "-k"
+ (string-append
+ ;; These tests cannot be run in parallel because their
+ ;; test data would not be copied by xdist and lead to
+ ;; import errors. (see:
+ ;; https://github.com/microsoft/debugpy/issues/342 and
+ ;; https://github.com/microsoft/debugpy/issues/880).
+ "not test_custom_python_args "
+ "and not test_autokill "))))))))
(native-inputs
;; See: https://raw.githubusercontent.com/microsoft/debugpy/
;; main/tests/requirements.txt.
--
2.35.1
M
M
Maxime Devos wrote on 9 Jun 2022 22:46
Re: [bug#55866] [PATCH 0/2] Disable tests failing due to YAMA’s ptrace_scope.
3f0ecc335e5ed0288e5e1573328f65c2f8f76c74.camel@telenet.be
Lars-Dominik Braun schreef op do 09-06-2022 om 10:51 [+0200]:
Toggle quote (9 lines)
> Hi,
>
> I noticed that some tests fail on my foreign distribution,
> but not on Guix System, because they differ in their
> /proc/sys/kernel/yama/ptrace_scope. Guix sets it to 0 (no limitations),
> whereas most distributions default to 1 (only children can be ptrace’d),
> causing a reproducibility issue. The following patches therefore disable
> tests, which fail with a setting of >0.

Sounds reasonable to me, though I recommend reporting the issue
upstream such that they can adjust their test suites to skip the tests
when YAMA interferes.

Greetings,Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqJcNhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rqoAPoDJX74h0jUyVMtX4G89gT/zuWU
vSoPqcQPSpkrZTPWogEAg3LNV7PA8nyo1QoGv9pAat1CSBRqcJtP01kAiSW+NAo=
=y1ri
-----END PGP SIGNATURE-----


L
L
Lars-Dominik Braun wrote on 10 Jun 2022 11:43
Re: [bug#55866] [PATCH 0/2] Disa ble tests failing due to YAMA’s ptrace_scope.
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 55866-done@debbugs.gnu.org)
YqMSLqthlR2xKSht@noor.fritz.box
Hi Maxime,

Toggle quote (3 lines)
> Sounds reasonable to me, though I recommend reporting the issue
> upstream such that they can adjust their test suites to skip the tests
> when YAMA interferes.
pushed as 9d2ef7344e340747640dc00413aa6a7b054f022a and
3e6bc1edca0c7ee4e8bfe0d8e783db48d2bb647c. I added a link to the upstream
report in the comments. Doesn’t make much sense for python-debugpy
though, since we’d end up with no test suite at all.

Thank you very much,
Lars
Closed
?