summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Brewer <fumanchu@aminus.org>2008-01-13 21:16:49 +0000
committerRobert Brewer <fumanchu@aminus.org>2008-01-13 21:16:49 +0000
commit963dc259b711edef6d04eab4ee65ed5e6890e93d (patch)
tree2d79dcca6eceac8238b5815c445179b231df216e
parentd3f3dddd052f7a796b82dfc76b41494a510890de (diff)
downloadcherrypy-git-cherrypy-3.0.3.tar.gz
Fix for #765 (Intermittent failure in 3.0.x session test).cherrypy-3.0.3
--HG-- branch : cherrypy-3.0.x
-rwxr-xr-xcherrypy/test/test_session.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/cherrypy/test/test_session.py b/cherrypy/test/test_session.py
index a078378e..41b35268 100755
--- a/cherrypy/test/test_session.py
+++ b/cherrypy/test/test_session.py
@@ -25,8 +25,8 @@ def setup_server():
_cp_config = {'tools.sessions.on': True,
'tools.sessions.storage_type' : 'ram',
'tools.sessions.storage_path' : localDir,
- 'tools.sessions.timeout': 0.017, # 1.02 secs
- 'tools.sessions.clean_freq': 0.017,
+ 'tools.sessions.timeout': (1.0 / 60),
+ 'tools.sessions.clean_freq': (1.0 / 60),
}
def testGen(self):
@@ -89,6 +89,12 @@ from cherrypy.test import helper
class SessionTest(helper.CPWebCase):
+ def tearDown(self):
+ # Clean up sessions.
+ for fname in os.listdir(localDir):
+ if fname.startswith(sessions.FileSession.SESSION_PREFIX):
+ os.unlink(os.path.join(localDir, fname))
+
def test_0_Session(self):
self.getPage('/testStr')
self.assertBody('1')
@@ -109,8 +115,8 @@ class SessionTest(helper.CPWebCase):
self.getPage('/delkey?key=counter', self.cookies)
self.assertStatus(200)
- # Wait for the session.timeout (1.02 secs)
- time.sleep(1.25)
+ # Wait for the session.timeout (1 second)
+ time.sleep(2)
self.getPage('/')
self.assertBody('1')