Commit Graph

24 Commits

Author SHA1 Message Date
Georg Brandl 9f2b93e03a Patch #1008: port test_signal to unittest. 2007-08-24 18:07:52 +00:00
Tim Peters 953c1897d2 Ah, fudge. One of the prints here actually "shouldn't be"
protected by "if verbose:", which caused the test to fail on
all non-Windows boxes.

Note that I deliberately didn't convert this to unittest yet,
because I expect it would be even harder to debug this on Tru64
after conversion.
2006-08-12 05:17:41 +00:00
Tim Peters 1742f3331f test_signal: Signal handling on the Tru64 buildbot
appears to be utterly insane.  Plug some theoretical
insecurities in the test script:

- Verify that the SIGALRM handler was actually installed.

- Don't call alarm() before the handler is installed.

- Move everything that can fail inside the try/finally,
  so the test cleans up after itself more often.

- Try sending all the expected signals in
  force_test_exit(), not just SIGALRM.  Since that was
  fixed to actually send SIGALRM (instead of invisibly
  dying with an AttributeError), we've seen that sending
  SIGALRM alone does not stop this from hanging.

- Move the "kill the child" business into the finally
  clause, so the child doesn't survive test failure
  to send SIGALRM to other tests later (there are also
  baffling SIGALRM-related failures in test_socket).

- Cancel the alarm in the finally clause -- if the
  test dies early, we again don't want SIGALRM showing
  up to confuse a later test.

Alas, this still relies on timing luck wrt the spawned
script that sends the test signals, but it's hard to see
how waiting for seconds can so often be so unlucky.

test_threadedsignals:  curiously, this test never fails
on Tru64, but doesn't normally signal SIGALRM.  Anyway,
fixed an obvious (but probably inconsequential) logic
error.
2006-08-12 04:42:47 +00:00
Tim Peters 8b8c59cf1d force_test_exit(): This has been completely ineffective
at stopping test_signal from hanging forever on the Tru64
buildbot.  That could be because there's no such thing as
signal.SIGALARM.  Changed to the idiotic (but standard)
signal.SIGALRM instead, and added some more debug output.
2006-08-11 03:49:10 +00:00
Neal Norwitz 3ee5941f68 Let us know when there was a problem and the child had to kill the parent 2006-08-02 06:19:19 +00:00
Neal Norwitz 313f8a903c Try to prevent hangs on Tru64/Alpha buildbot. I'm not certain this will help
and may need to be reverted if it causes problems.
2006-07-30 19:20:42 +00:00
Neal Norwitz ec3c5e396e Verify that the signal handlers were really called 2006-07-30 19:18:38 +00:00
Neal Norwitz 9730bcb4a6 Test getsignal() and some error conditions 2006-01-23 07:50:06 +00:00
Armin Rigo 8b2cbfd180 Let's not use string exceptions any more. 2004-08-07 21:27:43 +00:00
Michael W. Hudson 5c26e86096 lightly modified version of my patch
[ 971323 ] make test_signal less annoying
after some comments on IRC from a highly opinionated australian who
wishes to remain anonymous.
2004-06-11 18:09:28 +00:00
Tim Peters 0eadaac7dc Whitespace normalization. 2003-04-24 16:02:54 +00:00
Michael W. Hudson 43ed43bfc1 Take out my (long since disabled) POSIX signal mask handling code.
I'm not going to have the time or energy to get this working x-platform
-- anyone who does is welcome to the code!
2003-03-13 13:56:53 +00:00
Barry Warsaw 04f357cffe Get rid of relative imports in all unittests. Now anything that
imports e.g. test_support must do so using an absolute package name
such as "import test.test_support" or "from test import test_support".

This also updates the README in Lib/test, and gets rid of the
duplicate data dirctory in Lib/test/data (replaced by
Lib/email/test/data).

Now Tim and Jack can have at it. :)
2002-07-23 19:04:11 +00:00
Tim Peters c411dbaeee Whitespace normalization. 2002-07-16 21:35:23 +00:00
Michael W. Hudson 34f20eac98 This is patch
[ 559250 ] more POSIX signal stuff

Adds support (and docs and tests and autoconfery) for posix signal
mask handling -- sigpending, sigprocmask and sigsuspend.
2002-05-27 15:08:24 +00:00
Guido van Rossum e2ae77b8b8 SF patch #474590 -- RISC OS support 2001-10-24 20:42:55 +00:00
Fredrik Lundh f785042433 a bold attempt to fix things broken by MAL's verify patch: import
'verify' iff it's used by a test module...
2001-01-17 21:51:36 +00:00
Marc-André Lemburg 3661908a6a This patch removes all uses of "assert" in the regression test suite
and replaces them with a new API verify(). As a result the regression
suite will also perform its tests in optimization mode.

Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
2001-01-17 19:11:13 +00:00
Fred Drake 004d5e6880 Make reindent.py happy (convert everything to 4-space indents!). 2000-10-23 17:22:08 +00:00
Thomas Wouters b9fa0a843e Raise 'TestSkipped' (from the test_support) module rather than 'ImportError'
to signify a test that should be marked as 'skipped' rather than 'failed'.
Also 'document' it, in README.
2000-08-04 13:34:43 +00:00
Guido van Rossum 8e9ebfd337 os2 patch by Jeff Rush 1997-11-22 21:53:48 +00:00
Guido van Rossum cc5a91dc4f Soft failure for Win32 platform. 1997-04-16 00:29:15 +00:00
Barry Warsaw 5e056bbb76 test_rotor.py: New test of the rotor module.
test_*: converted to the new test harness.  GvR note!  test_signal.py
works interatively (i.e. when verbose=1) but does not work inside the
test harness.  It must be a timing issue, but I haven't figured it out
yet.
1996-12-23 23:39:42 +00:00
Guido van Rossum 4f17e3e2f9 test signal module 1995-03-16 15:07:38 +00:00