Change in vdsm[master]: Make jsonrpc test timeout constant

smizrahi at redhat.com smizrahi at redhat.com
Wed Dec 19 21:35:36 UTC 2012


Saggi Mizrahi has uploaded a new change for review.

Change subject: Make jsonrpc test timeout constant
......................................................................

Make jsonrpc test timeout constant

Change-Id: Ica0e37cc70b218d2aae45a0651bc7de00f09d824
Signed-off-by: Saggi Mizrahi <smizrahi at redhat.com>
---
M tests/jsonRpcTests.py
1 file changed, 10 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/10253/1

diff --git a/tests/jsonRpcTests.py b/tests/jsonRpcTests.py
index da8ff5d..c79656f 100644
--- a/tests/jsonRpcTests.py
+++ b/tests/jsonRpcTests.py
@@ -50,6 +50,8 @@
 
 _distributedPorts = []
 
+CALL_TIMEOUT = 5
+
 
 def _getFreePort():
     sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@@ -276,12 +278,12 @@
                     for client in clients:
                         for i in range(subRepeats):
                             self.log.info("Sending message...")
-                            client.sendMessage(data, 1)
+                            client.sendMessage(data, CALL_TIMEOUT)
 
                 for i in range(repeats * subRepeats):
                     for client in clients:
                             self.log.info("Waiting for reply...")
-                            retData = client.recvMessage(1)
+                            retData = client.recvMessage(CALL_TIMEOUT)
                             self.log.info("Asserting reply...")
                             self.assertEquals(retData, data)
             finally:
@@ -305,7 +307,8 @@
             client = clientFactory()
             client.connect()
             with closing(client):
-                self.assertEquals(client.callMethod("echo", (data,), 10, 1),
+                self.assertEquals(client.callMethod("echo", (data,), 10,
+                                                    CALL_TIMEOUT),
                                   data)
 
     @permutations(REACTOR_TYPE_PERMUTATIONS)
@@ -319,7 +322,7 @@
             with closing(client):
                 self.assertEquals(client.callMethod("echo",
                                                     {'text': data},
-                                                    10, 1),
+                                                    10, CALL_TIMEOUT),
                                   data)
 
     @permutations(REACTOR_TYPE_PERMUTATIONS)
@@ -330,7 +333,8 @@
             client.connect()
             with closing(client):
                 with self.assertRaises(JsonRpcError) as cm:
-                    client.callMethod("I.DO.NOT.EXIST :(", [], 10, 1)
+                    client.callMethod("I.DO.NOT.EXIST :(", [], 10,
+                                      CALL_TIMEOUT)
 
                 self.assertEquals(cm.exception.code,
                                   JsonRpcMethodNotFoundError().code)
@@ -345,7 +349,7 @@
             client.connect()
             with closing(client):
                 with self.assertRaises(JsonRpcError) as cm:
-                    client.callMethod("echo", [], 10, timeout=1)
+                    client.callMethod("echo", [], 10, timeout=CALL_TIMEOUT)
 
                 self.assertEquals(cm.exception.code,
                                   JsonRpcInternalError().code)


--
To view, visit http://gerrit.ovirt.org/10253
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica0e37cc70b218d2aae45a0651bc7de00f09d824
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi at redhat.com>


More information about the vdsm-patches mailing list