Opened 6 years ago

Closed 3 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:
Author: Launchpad Bug:

Description

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/test_process.py:10: DeprecationWarning:
The popen2 module is deprecated.  Use the subprocess module.
  import popen2
twisted.test.test_process
  PosixProcessTestCasePTY
    testBadArgs ...                                                        [OK]
    testNormalTermination ...                                           [ERROR]
/usr/local/lib/python2.6/dist-packages/twisted/test/test_process.py:988: PotentialZombieWarning:
 spawnProcess called, but the SIGCHLD handler is not installed. This probably means you have not
 yet called reactor.run, or called reactor.run(installSignalHandler=0). 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/_baseprocess.py", line 60, in maybeCallProcessEnded
    proto.processEnded(Failure(reason))
  File "/usr/local/lib/python2.6/dist-packages/twisted/test/test_process.py", line 165, in processEnded
    self.deferred.callback(None)
  File "/usr/local/lib/python2.6/dist-packages/twisted/internet/defer.py", line 241, in callback
    self._startRunCallbacks(result)
  File "/usr/local/lib/python2.6/dist-packages/twisted/internet/defer.py", line 296, in _startRunCallbacks
    raise AlreadyCalledError
twisted.internet.defer.AlreadyCalledError: 
-------------------------------------------------------------------------------
Ran 10 tests in 120.970s

FAILED (errors=2, successes=8)

Twisted version: trunk, svn r26968

Change History (5)

comment:1 Changed 6 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 script.py --some-args

shift 0

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

comment:2 Changed 5 years ago by glyph

  • Owner changed from glyph to ivank

comment:3 Changed 5 years ago by ivank

  • Priority changed from normal to lowest

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 3 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 3 years ago by ivank

  • Resolution set to fixed
  • Status changed from new to closed

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.