This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: buildbot: test_send_signal of test_subprocess failure
Type: behavior Stage:
Components: Tests Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: flox, gregory.p.smith, michael.foord, pitrou, skrah, vstinner
Priority: normal Keywords: buildbot

Created on 2010-04-17 16:36 by vstinner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (12)
msg103409 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-17 16:36
http://www.python.org/dev/buildbot/builders/x86 FreeBSD 3.x/builds/211/steps/test/logs/stdio

Example:
======================================================================
FAIL: test_send_signal (test.test_subprocess.POSIXProcessTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_subprocess.py", line 770, in test_send_signal
    self.assertIn(b'KeyboardInterrupt', stderr)
AssertionError: b'KeyboardInterrupt' not found in b''

----------------------------------------------------------------------
msg103455 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-17 23:35
See also issue #8263.
msg104979 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-05-04 22:06
I get this same failure on Mac OS X 10.6.3 as well.
msg113503 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-08-10 01:14
Since it only happens on 3.x, a possible culprit is “[svn r78946] Replaces the internals of the subprocess module from fork through exec on
POSIX systems with a C extension module”.

NB: recent URL of deterministic failure under FreeBSD 6.4:
http://www.python.org/dev/buildbot/builders/x86%20FreeBSD%203.x/builds/492
msg113519 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-08-10 09:58
http://www.python.org/dev/buildbot/builders/x86%20FreeBSD%203.x/builds/492

On this report, both implementations (Python and C) failed:

FAIL: test_send_signal (test.test_subprocess.POSIXProcessTestCase)
FAIL: test_send_signal (test.test_subprocess.ProcessTestCasePOSIXPurePython)

--

The problem is maybe that the SIGINT is ignored on these particular platforms (FreeBSD and Mac OS X). I worked on this topic recently (see issue #3137) and I cannot guarantee that exceptions are still ignored somewhere. I can investigate if you give me access to the platform.

My procedure was to run python in gdb, set a break point, and send the signal at different points until the KeyboardInterrupt is no more ignored anywhere.
msg113520 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-08-10 10:04
> The problem is maybe that the SIGINT is ignored on these particular
> platforms (FreeBSD and Mac OS X). I worked on this topic recently (see
> issue #3137) and I cannot guarantee that exceptions are still ignored
> somewhere. I can investigate if you give me access to the platform.

These tests exist and pass on 2.7 and 3.1.
msg113525 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-08-10 11:48
> These tests exist and pass on 2.7 and 3.1.

Ok. In r78946, for the pure Python implementation, I only see the restoration of the signals which can be related to this issue.
msg113720 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-08-12 23:06
Issue 8714 could be related as well: On OpenBSD, after a KeyboardInterrupt
one has to hit <Return> before the traceback appears.

This was introduced in (or exposed by) r68460. When Python is compiled
without threads, the bug does not occur.
msg114791 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-08-24 14:39
Also occurs on Python 2.7, with "x86 FreeBSD 7.2" buildbot.
(I found it on many builds since revision 83725 at least. Older builds are not available)
Seen on "x86 FreeBSD" buildbot, too.


test test_subprocess failed -- Traceback (most recent call last):
  File "/usr/home/db3l/buildarea/2.7.bolen-freebsd7/build/Lib/test/test_subprocess.py", line 723, in test_send_signal
    self.assertIn('KeyboardInterrupt', stderr)
AssertionError: 'KeyboardInterrupt' not found in ''

http://www.python.org/dev/buildbot/builders/x86%20FreeBSD%207.2%202.7/builds/89
http://www.python.org/dev/buildbot/builders/x86%20FreeBSD%207.2%202.7/builds/51
msg116899 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-09-20 00:27
The test fails mostly on very slow machines (not only BSD ones, but also the Debian sparc buildbot).
Therefore, I've attempted a fix in r84910 by relaxing timings, and simply skipping the test if it seems we couldn't send the signal in time.
msg116901 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-09-20 00:40
The fix succeeded on the "sparc Debian 3.x" buildbot while test_subprocess had been failing consistently before.
msg116918 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-09-20 08:58
test_subprocess now succeeds on all 3.x buildbots. Will backport and then close.
History
Date User Action Args
2022-04-11 14:57:00adminsetgithub: 52679
2010-09-20 11:22:25pitrousetstatus: pending -> closed
2010-09-20 08:58:07pitrousetstatus: open -> pending
resolution: fixed
messages: + msg116918
2010-09-20 00:40:14pitrousetmessages: + msg116901
2010-09-20 00:27:50pitrousetmessages: + msg116899
2010-08-24 14:39:48floxsetversions: + Python 2.7
nosy: + flox

messages: + msg114791

components: + Tests
type: behavior
2010-08-12 23:06:03skrahsetnosy: + skrah
messages: + msg113720
2010-08-10 11:48:48vstinnersetmessages: + msg113525
2010-08-10 10:04:04pitrousetmessages: + msg113520
2010-08-10 09:58:50vstinnersetmessages: + msg113519
2010-08-10 01:14:37pitrousetnosy: + gregory.p.smith, pitrou
messages: + msg113503
2010-05-04 22:06:48michael.foordsetnosy: + michael.foord
messages: + msg104979
2010-04-30 16:08:56vstinnersettitle: build: test_send_signal of test_subprocess failure -> buildbot: test_send_signal of test_subprocess failure
2010-04-17 23:35:50vstinnersetmessages: + msg103455
2010-04-17 16:36:33vstinnercreate