You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bsddb/test/test_lock.py sometimes fails due to floating point error #49323
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2009-01-26.22:03:12.025>created_at=<Date2009-01-26.20:20:17.309>labels= ['tests']
title='bsddb/test/test_lock.py sometimes fails due to floating point error'updated_at=<Date2010-03-15.14:13:18.327>user='https://bugs.python.org/ocean-city'
time.time() returns floating point, so sometimes folloing assertion in
LockingTestCase#test03_lock_timeout fails due to floating point
calculation error.
self.assertTrue((end_time-start_time) >= 0.1
end_time-start_time becomes 0.0999999046326 for instance. I ran
test_lock.py 100 times after applied the attached patch, I saw no error.
Activity
ocean-city commentedon Jan 26, 2009
time.time() returns floating point, so sometimes folloing assertion in
LockingTestCase#test03_lock_timeout fails due to floating point
calculation error.
end_time-start_time becomes 0.0999999046326 for instance. I ran
test_lock.py 100 times after applied the attached patch, I saw no error.
mdickinson commentedon Jan 26, 2009
Looks good to me! If it were me I'd probably just code the test directly
as
self.assertTrue((end_time-start_time) >= 0.0999)
to avoid having to look for epsilon when reading.
Do you want to commit it or shall I?
ocean-city commentedon Jan 26, 2009
Could you commit please? :-)
mdickinson commentedon Jan 26, 2009
Fixed in r68978 (trunk) and r68979 (2.6). bsddb is no longer part of the
standard Python distribution for 3.x, so the patch doesn't apply there.
Thank you!
jcea commentedon Mar 15, 2010
Patch up-ported to pybsddb 4.8.4.