Issue 5073: bsddb/test/test_lock.py sometimes fails due to floating point error
Created on 2009-01-26 20:20 by ocean-city, last changed 2022-04-11 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test_lock.patch | ocean-city, 2009-01-26 20:20 | |||
| Messages (5) | |||
|---|---|---|---|
| msg80589 - (view) | Author: Hirokazu Yamamoto (ocean-city) * ![]() |
Date: 2009-01-26 20:20 | |
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. |
|||
| msg80592 - (view) | Author: Mark Dickinson (mark.dickinson) * ![]() |
Date: 2009-01-26 21:17 | |
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? |
|||
| msg80594 - (view) | Author: Hirokazu Yamamoto (ocean-city) * ![]() |
Date: 2009-01-26 21:40 | |
Could you commit please? :-) |
|||
| msg80596 - (view) | Author: Mark Dickinson (mark.dickinson) * ![]() |
Date: 2009-01-26 22:03 | |
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! |
|||
| msg101112 - (view) | Author: Jesús Cea Avión (jcea) * ![]() |
Date: 2010-03-15 14:13 | |
Patch up-ported to pybsddb 4.8.4. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:44 | admin | set | github: 49323 |
| 2010-03-15 14:13:18 | jcea | set | nosy:
+ jcea messages: + msg101112 |
| 2009-01-26 22:03:12 | mark.dickinson | set | status: open -> closed resolution: accepted -> fixed messages: + msg80596 |
| 2009-01-26 21:40:56 | ocean-city | set | messages: + msg80594 |
| 2009-01-26 21:17:50 | mark.dickinson | set | resolution: accepted messages: + msg80592 nosy: + mark.dickinson |
| 2009-01-26 20:20:17 | ocean-city | create | |
