Subject: bug#25988: [PATCH] bug#25988: python2-urwid tests fail

From: Maxim Cournoyer <[email-masked]>
Date: Sun, 30 Apr 2017 15:44:12 +0900

Hi Ludovic,

[email-masked] (Ludovic Courtès) writes:

[...]

>
> I’ve seen the failure once and it succeeded on a subsequent rebuild, so
> I came to the conclusion that this is a non-deterministic failure.  That
> would explain why the problem doesn’t show up on Hydra.
>
> Does it fail systematically for you?
>

Yes, it does! I can re-run the `guix system reconfigure ...' as
many times as I want and always get the same two failures. However, if I
keep the failed derivation and run the tests manually, I've found that
using 'strace' will cause more failures/errors; so it seems
non-deterministic; maybe a racing issue?

I've opened an issue on their GitHub tracker
(https://github.com/urwid/urwid/issues/230). Interestingly the same
tests run fine with Python 3, with or without using strace.

I've attached a patch that disables the problematic vterm tests, only
for the python2-urwid package.

Maxim

From 56e769bee4a47136e0eee251c87a58b8359a8611 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <[email-masked]>
Date: Sun, 30 Apr 2017 14:55:47 +0900
Subject: [PATCH] gnu: Disable vterm tests for python2-urwid

* gnu/packages/python.scm (python2-urwid)['delete-test_vterm]: Add phase to
delete problematic test modules.
---
 gnu/packages/python.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 22fadea275..c6c0978038 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -5509,7 +5509,18 @@ features useful for text console applications.")
     (license license:lgpl2.1+)))
 
 (define-public python2-urwid
-  (package-with-python2 python-urwid))
+  (let ((python2-urwid (package-with-python2 python-urwid)))
+    (package
+      (inherit python2-urwid)
+      (arguments
+       (append
+        '(#:phases
+          (modify-phases %standard-phases
+            ;; Disable the vterm tests because of non-deterministic failures
+            ;; with Python 2. See https://github.com/urwid/urwid/issues/230.
+            (add-after 'unpack 'delete-test_vterm.py
+              (delete-file "urwid/tests/test_vterm.py"))))
+        (package-arguments python-urwid))))))
 
 (define-public python-openid
   (package
-- 
2.12.0