Commit Graph

7 Commits

Author SHA1 Message Date
Michael W. Hudson fcc09bbad6 Don't exit test_main() with the lock 'done' held -- there's no cleaner
way to guarantee a deadlock on the next call!

If I've inadvertently done some damage to this test, sorry (but I don't
think I have).
2004-08-03 10:45:59 +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 20882dd174 SF bug #516372: test_thread: unhandled exc. in thread
Fix exit races in test_thread.py and test_threaded_import.py.
I suspect the bug is provokable only under Linux (where child threads
seem to get lots of cycles before they get killed after the main thread
exits), or on multi-processor machines running other OSes.
Bugfix candidate.
2002-02-16 07:26:27 +00:00
Tim Peters 692323488b Add a new function imp.lock_held(), and use it to skip test_threaded_import
when that test is doomed to deadlock.
2001-08-30 05:16:13 +00:00
Jack Jansen 87797872a8 Workaround by Tim Peters to skip this test if run from test.autotest,
in which case it will hang because the import lock is already held
by the main thread.
2001-08-29 20:26:24 +00:00
Tim Peters d97422115e Implementing an idea from Guido on the checkins list:
When regrtest.py finds an attribute "test_main" in a test it imports,
regrtest runs the test's test_main after the import.  test_threaded_import
needs this else the cross-thread import lock prevents it from making
progress.  Other tests can use this hack too, but I doubt it will ever be
popular.
2001-05-22 18:28:25 +00:00
Tim Peters aa222234c0 New test adapted from the ancient Demo/threads/bug.py.
ICK ALERT:  read the long comment block before run_the_test().  It was
almost impossible to get this to run without instant deadlock, and the
solution here sucks on several counts.  If you can dream up a better way,
let me know!
2001-05-22 09:34:27 +00:00