unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: guix-devel@gnu.org
Subject: Python 3 test failures
Date: Thu, 03 Apr 2014 18:32:29 +0200	[thread overview]
Message-ID: <87ppkype5e.fsf_-_@gnu.org> (raw)
In-Reply-To: <87lhvnikjp.fsf@yeeloong.lan> (Mark H. Weaver's message of "Wed, 02 Apr 2014 15:43:54 -0400")

[-- Attachment #1: Type: text/plain, Size: 2922 bytes --]

Mark H Weaver <mhw@netris.org> skribis:

> ======================================================================
> ERROR: test_fork (test.test_pty.PtyTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/tmp/nix-build-python-3.3.3.drv-13/Python-3.3.3/Lib/test/test_pty.py", line 116, in test_fork
>     pid, master_fd = pty.fork()
>   File "/tmp/nix-build-python-3.3.3.drv-13/Python-3.3.3/Lib/pty.py", line 107, in fork
>     master_fd, slave_fd = openpty()
>   File "/tmp/nix-build-python-3.3.3.drv-13/Python-3.3.3/Lib/pty.py", line 29, in openpty
>     master_fd, slave_name = _open_terminal()
>   File "/tmp/nix-build-python-3.3.3.drv-13/Python-3.3.3/Lib/pty.py", line 70, in _open_terminal
>     raise os.error('out of pty devices')
> OSError: out of pty devices

This particular test is fixed by the daemon patch I posted, which makes
sure /dev/pts/ptmx is 0666 (I’ll update nix-upstream.)

Now I see one remaining failure:

--8<---------------cut here---------------start------------->8---
[374/374/1] test_multiprocessing
/tmp/nix-build-python-3.3.3.drv-1/Python-3.3.3/Lib/multiprocessing/process.py:95: ResourceWarning: unclosed <socket.socket object, fd=7, family=1, type=1, proto=0>
  self._target(*self._args, **self._kwargs)
Warning -- multiprocessing.process._dangling was modified by test_multiprocessing
test test_multiprocessing failed -- Traceback (most recent call last):
  File "/tmp/nix-build-python-3.3.3.drv-1/Python-3.3.3/Lib/test/test_multiprocessing.py", line 1035, in test_wait_result
    self.assertRaises(KeyboardInterrupt, c.wait, 10)
AssertionError: KeyboardInterrupt not raised by wait
--8<---------------cut here---------------end--------------->8---

This test exercises the ‘Condition’ API, which implements an
inter-process synchronization primitive similar to condition variables,
on top of semaphores (sem_open):

--8<---------------cut here---------------start------------->8---
    def _test_wait_result(cls, c, pid):
        with c:
            c.notify()
        time.sleep(1)
        if pid is not None:
            os.kill(pid, signal.SIGINT)

    def test_wait_result(self):
        if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
            pid = os.getpid()
        else:
            pid = None

        c = self.Condition()
        with c:
            self.assertFalse(c.wait(0))
            self.assertFalse(c.wait(0.1))

            p = self.Process(target=self._test_wait_result, args=(c, pid))
            p.start()

            self.assertTrue(c.wait(10))
            if pid is not None:
                self.assertRaises(KeyboardInterrupt, c.wait, 10)

            p.join()
--8<---------------cut here---------------end--------------->8---

I thought that the test might be racy, so I tried this patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 697 bytes --]

--- Lib/test/test_multiprocessing.py	2014-04-03 18:04:55.000000000 +0200
+++ Lib/test/test_multiprocessing.py	2014-04-03 18:05:08.000000000 +0200
@@ -1012,7 +1012,7 @@ class _TestCondition(BaseTestCase):
     def _test_wait_result(cls, c, pid):
         with c:
             c.notify()
-        time.sleep(1)
+        time.sleep(20)
         if pid is not None:
             os.kill(pid, signal.SIGINT)
 
@@ -1032,7 +1032,7 @@ class _TestCondition(BaseTestCase):
 
             self.assertTrue(c.wait(10))
             if pid is not None:
-                self.assertRaises(KeyboardInterrupt, c.wait, 10)
+                self.assertRaises(KeyboardInterrupt, c.wait, 60)
 
             p.join()
 

[-- Attachment #3: Type: text/plain, Size: 137 bytes --]


It doesn’t help, though.

The test passes outside of the chroot.  I haven’t tried stracing it yet.

Help welcome!

Ludo’.

  reply	other threads:[~2014-04-03 16:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-27 23:07 0.6 is around the corner! Ludovic Courtès
2014-04-01 18:50 ` Mark H Weaver
2014-04-01 19:20   ` Mark H Weaver
2014-04-01 20:02     ` Ludovic Courtès
2014-04-01 19:25   ` Ludovic Courtès
2014-04-02 19:43     ` Mark H Weaver
2014-04-03 16:32       ` Ludovic Courtès [this message]
2014-04-03 17:11         ` Python 3 test failures Mark H Weaver
2014-04-03 19:51           ` Ludovic Courtès
2014-04-06 19:41     ` 0.6 is around the corner! Ludovic Courtès
2014-04-06 21:33       ` [PATCH] gnu: Python: disable test_wait_result() as it fails on some setups Cyril Roelandt
2014-04-07  6:17         ` Mark H Weaver
2014-04-07 22:13           ` [PATCH] gnu: Python: disable failing tests on MIPS64 Cyril Roelandt
2014-04-08  0:10             ` Mark H Weaver
2014-04-08  3:50               ` Mark H Weaver
2014-04-09  0:40               ` Nikita Karetnikov
2014-04-09  2:51                 ` Cyril Roelandt
2014-04-09 16:04                   ` Nikita Karetnikov
2014-04-07  7:41         ` [PATCH] gnu: Python: disable test_wait_result() as it fails on some setups Ludovic Courtès
2014-04-07 21:45         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ppkype5e.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).