mirror of https://github.com/m-labs/artiq.git
test/pc_rpc: support slow server startups
This commit is contained in:
parent
934442bd07
commit
ea37274c09
|
@ -22,8 +22,14 @@ class RPCCase(unittest.TestCase):
|
||||||
test_object = [5, 2.1, None, True, False,
|
test_object = [5, 2.1, None, True, False,
|
||||||
{"a": 5, 2: np.linspace(0, 10, 1)},
|
{"a": 5, 2: np.linspace(0, 10, 1)},
|
||||||
(4, 5), (10,), "ab\nx\"'"]
|
(4, 5), (10,), "ab\nx\"'"]
|
||||||
time.sleep(.5) # wait for the server to start
|
for attempt in range(100):
|
||||||
remote = pc_rpc.Client(test_address, test_port)
|
time.sleep(.2)
|
||||||
|
try:
|
||||||
|
remote = pc_rpc.Client(test_address, test_port)
|
||||||
|
except ConnectionRefusedError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
break
|
||||||
try:
|
try:
|
||||||
test_object_back = remote.echo(test_object)
|
test_object_back = remote.echo(test_object)
|
||||||
with self.assertRaises(pc_rpc.RemoteError):
|
with self.assertRaises(pc_rpc.RemoteError):
|
||||||
|
|
Loading…
Reference in New Issue