Mark H Weaver <m...@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:

--- 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()
 
It doesn’t help, though.

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

Help welcome!

Ludo’.

Reply via email to