Opened 9 years ago

Closed 6 years ago

#3872 defect closed fixed (fixed)

Intermittent test failures in twisted.test.test_process.PosixProcessTestCasePTY

Reported by: ivank Owned by: ivank
Priority: lowest Milestone:
Component: core Keywords:
Cc: jesstess, ivank Branch:


After running PosixProcessTestCasePTY a few hundred times (with an script running trial twisted.test.test_process.PosixProcessTestCasePTY), I see this on Ubuntu 9.04 server 64 bit (with its default Python 2.6.2 install):

/usr/local/lib/python2.6/dist-packages/twisted/test/ DeprecationWarning:
The popen2 module is deprecated.  Use the subprocess module.
  import popen2
    testBadArgs ...                                                        [OK]
    testNormalTermination ...                                           [ERROR]
/usr/local/lib/python2.6/dist-packages/twisted/test/ PotentialZombieWarning:
 spawnProcess called, but the SIGCHLD handler is not installed. This probably means you have not
 yet called, or called You will probably never
 see this process finish, and it may become a zombie process.
    testOpeningTTY ...                                                  [ERROR]
    test_abnormalTermination ...                                           [OK]
    test_errorInProcessEnded ...                                           [OK]
    test_executionError ...                                                [OK]
    test_signalHUP ...                                                     [OK]
    test_signalINT ...                                                     [OK]
    test_signalKILL ...                                                    [OK]
    test_signalTERM ...                                                    [OK]

[ERROR]: twisted.test.test_process.PosixProcessTestCasePTY.testNormalTermination

Traceback (most recent call last):
Failure: twisted.internet.defer.TimeoutError: <twisted.test.test_process.PosixProcessTestCasePTY
 testMethod=testNormalTermination> (testNormalTermination) still running at 120.0 secs
[ERROR]: twisted.test.test_process.PosixProcessTestCasePTY.testOpeningTTY

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/twisted/internet/", line 60, in maybeCallProcessEnded
  File "/usr/local/lib/python2.6/dist-packages/twisted/test/", line 165, in processEnded
  File "/usr/local/lib/python2.6/dist-packages/twisted/internet/", line 241, in callback
  File "/usr/local/lib/python2.6/dist-packages/twisted/internet/", line 296, in _startRunCallbacks
    raise AlreadyCalledError
Ran 10 tests in 120.970s

FAILED (errors=2, successes=8)

Twisted version: trunk, svn r26968

Change History (5)

comment:1 Changed 9 years ago by ivank

I also get the exact same errors and traceback when using the libevent reactor (from launchpad).

I used this script looper-stop to run trial:

#!/bin/bash -e

# Starts a process in a while 1 loop. Stop restarting if the exit code is non-zero.

# Sample usage:
# looper-stop ls -l
# looper-stop python --some-args

shift 0

while [ 1 ]; do
        echo "[`date`] starting: ${*}"
        echo "Process done."
        sleep 0.25

comment:2 Changed 9 years ago by Glyph

Owner: changed from Glyph to ivank

comment:3 Changed 8 years ago by ivank

Priority: normallowest

I cannot reproduce this with Twisted r28631, Python 2.7a3, Ubuntu 9.10 server 64 bit. Nor with the operating system's default Python 2.6.4.

I don't know if anything relevant has actually changed in any of Twisted, Python, or Ubuntu.

comment:4 Changed 6 years ago by jesstess

Cc: jesstess ivank added

I wasn't able to reproduce this after 1000 loops through twisted.test.test_process.PosixProcessTestCasePTY on trunk (r33705) with:

  • Python 2.6 or 2.7 on OS X 10.6
  • Python 2.6 or 2.7 on Ubuntu 11.04.

ivank, can you still reproduce this in some environment?

comment:5 Changed 6 years ago by ivank

Resolution: fixed
Status: newclosed

I can't reproduce this on Twisted trunk running in CentOS 6.3 or Gentoo. This is not surprising, because spawnProcess was fixed to not emit PotentialZombieWarning. (Could have been something else, though.)

Note: See TracTickets for help on using tickets.