Author: dreiss
Date: Sat Jan 31 21:39:08 2009
New Revision: 739628
URL: http://svn.apache.org/viewvc?rev=739628&view=rev
Log:
python: Make the unit tests run faster and more reliably
- The async test was making the server sleep for 2 seconds. Cut it to 0.5.
- The test driver was waiting 5 seconds for shutdown. Cut it to 1.
- Add a 0.25 second sleep to make sure the server comes up before the client.
This is all a bit hacky, but it is better than the status quo.
Modified:
incubator/thrift/trunk/test/py/RunClientServer.py
incubator/thrift/trunk/test/py/TestClient.py
Modified: incubator/thrift/trunk/test/py/RunClientServer.py
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/test/py/RunClientServer.py?rev=739628&r1=739627&r2=739628&view=diff
==============================================================================
--- incubator/thrift/trunk/test/py/RunClientServer.py (original)
+++ incubator/thrift/trunk/test/py/RunClientServer.py Sat Jan 31 21:39:08 2009
@@ -14,6 +14,7 @@
def runTest(server_class):
print "Testing ", server_class
serverproc = subprocess.Popen([sys.executable, relfile("TestServer.py"),
server_class])
+ time.sleep(0.25)
try:
argv = [sys.executable, relfile("TestClient.py")]
if server_class in FRAMED:
@@ -26,7 +27,7 @@
os.kill(serverproc.pid, signal.SIGKILL)
# wait for shutdown
- time.sleep(5)
+ time.sleep(1)
map(runTest, ["TForkingServer", "TThreadPoolServer",
"TThreadedServer", "TSimpleServer", "TNonblockingServer"])
Modified: incubator/thrift/trunk/test/py/TestClient.py
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/test/py/TestClient.py?rev=739628&r1=739627&r2=739628&view=diff
==============================================================================
--- incubator/thrift/trunk/test/py/TestClient.py (original)
+++ incubator/thrift/trunk/test/py/TestClient.py Sat Jan 31 21:39:08 2009
@@ -99,7 +99,7 @@
def testAsync(self):
start = time.time()
- self.client.testAsync(2)
+ self.client.testAsync(0.5)
end = time.time()
self.assertTrue(end - start < 0.2,
"async sleep took %f sec" % (end - start))