Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
ad7964a3
Commit
ad7964a3
authored
Jun 18, 2003
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testLastAccessed(): This often failed on Windows. Fixed. Extensive
new comment block explains the cause and the cure.
parent
1133226e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
lib/python/Products/Transience/tests/testTimeoutRelated.py
lib/python/Products/Transience/tests/testTimeoutRelated.py
+14
-1
No files found.
lib/python/Products/Transience/tests/testTimeoutRelated.py
View file @
ad7964a3
...
...
@@ -77,7 +77,20 @@ class TestLastAccessed(TestBase):
def
testLastAccessed
(
self
):
sdo
=
self
.
app
.
sm
.
new_or_existing
(
'TempObject'
)
la1
=
sdo
.
getLastAccessed
()
fauxtime
.
sleep
(
WRITEGRANULARITY
+
1
)
# time.time() on Windows has coarse granularity (updates at
# 18.2 Hz -- about once each 0.055 seconds). We have to sleep
# long enough so that "the next" call to time.time() actually
# delivers a larger value. _last_accessed isn't actually updated
# unless current time.time() is greater than the last value +
# WRITEGRANULARITY. The time() and sleep() are fudged by a
# factor of 60, though. The code here used to do
# fauxtime.sleep(WRITEGRANULARITY + 1)
# and that wasn't enough on Windows. The "+1" only added 1/60th
# of a second sleep time in real time, much less than the Windows
# time.time() resolution. Rounding up 0.055 to 1 digit and
# multiplying by 60 ensures that we'll actually sleep long enough
# to get to the next Windows time.time() tick.
fauxtime
.
sleep
(
WRITEGRANULARITY
+
0.06
*
60
)
sdo
=
self
.
app
.
sm
.
get
(
'TempObject'
)
assert
sdo
.
getLastAccessed
()
>
la1
,
(
sdo
.
getLastAccessed
(),
la1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment