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: test_decimal: possible thread lockup in test case
Type: crash Stage:
Components: Library (Lib) Versions: Python 2.6, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: facundobatista Nosy List: facundobatista, jaredgrubb, mark.dickinson
Priority: normal Keywords: patch

Created on 2008-03-11 16:46 by jaredgrubb, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_decimal.patch jaredgrubb, 2008-03-11 16:46 Patch for the two bugs mentioned
test_decimal_thread.patch mark.dickinson, 2008-03-11 19:35
Messages (4)
msg63463 - (view) Author: Jared Grubb (jaredgrubb) Date: 2008-03-11 16:46
In Lib\test\test_decimal.py, attached is a bugfix for two bugs:
1) If the thfunc2 actually fails, then its thread will throw an
exception and never set the Events that thfunc1 is waiting for; thus,
thfunc1 never returns, causing the whole unittest to hang.
2) DecimalUseOfContextTest.test_threading should wait on both finish1
and finish2 (instead of waiting on finish1 twice).
msg63464 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-03-11 19:35
This is a minor annoyance that's tripped me up before as well.  Only 
minor, since it only happens when there's something wrong with 
decimal.py.

The patch looks sound;  I've attached a regenerated version of it 
against the trunk.  (Note that the finish1 -> finish2 bug was already 
fixed in the trunk.)  I think it should be applied, and probably 
backported to 2.5 as well.

Jared, thanks for the report and the patch!  I'm curious to know how you 
encountered this;  if test_decimal is failing for a good reason, then 
there may be a Decimal bug to be fixed.
msg63468 - (view) Author: Jared Grubb (jaredgrubb) Date: 2008-03-12 01:52
I ran into this bug because I created a context manager in one of my own
projects, and the regression tests in test_decimal looked like a good
start for my own regression tests... when some recent changes broke MY
code, I found the test bug too and realized that the test_decimal file
had the same problem. So, I figured I'd share the wealth :)
msg64313 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-03-22 02:46
Commited in r61731.

Thank you both!
History
Date User Action Args
2022-04-11 14:56:31adminsetgithub: 46526
2008-03-22 02:46:05facundobatistasetstatus: open -> closed
resolution: fixed
messages: + msg64313
2008-03-12 01:52:20jaredgrubbsetmessages: + msg63468
2008-03-11 19:35:16mark.dickinsonsetfiles: + test_decimal_thread.patch
nosy: + mark.dickinson
messages: + msg63464
versions: + Python 2.6
2008-03-11 16:47:22facundobatistasetassignee: facundobatista
nosy: + facundobatista
2008-03-11 16:46:14jaredgrubbcreate