Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions 11 Lib/bsddb/test/test_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
TestCases for testing the locking sub-system.
"""

import sys
import time

import unittest
Expand All @@ -10,7 +11,6 @@

if have_threads :
from threading import Thread
import sys
if sys.version_info[0] < 3 :
from threading import currentThread
else :
Expand Down Expand Up @@ -129,7 +129,14 @@ def deadlock_detection() :
end_time=time.time()
deadlock_detection.end=True
# Floating point rounding
self.assertGreaterEqual(end_time-start_time, 0.0999)
if sys.platform == 'win32':
# bpo-30850: On Windows, tolerate 50 ms whereas 100 ms is expected.
# The lock sometimes times out after only 58 ms. Windows clocks
# have a bad resolution and bad accuracy.
min_dt = 0.050
else:
min_dt = 0.0999
self.assertGreaterEqual(end_time-start_time, min_dt)
self.env.lock_put(lock)
t.join()

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.