MCPcopy Index your code
hub / github.com/apache/tvm / check_timeout

Function check_timeout

tests/python/contrib/test_rpc_tracker.py:67–94  ·  view source on GitHub ↗
(timeout, sleeptime)

Source from the content-addressed store, hash-verified

65
66 # Fault tolerence server timeout
67 def check_timeout(timeout, sleeptime):
68 def myfunc(remote):
69 time.sleep(sleeptime)
70 f1 = remote.get_function("rpc.test2.addone")
71 assert f1(10) == 11
72
73 try:
74 tclient.request_and_run("xyz", myfunc, session_timeout=timeout)
75 except RuntimeError:
76 pass
77 print(tclient.text_summary())
78 try:
79 remote = tclient.request("xyz", priority=0, session_timeout=timeout)
80 remote2 = tclient.request("xyz", session_timeout=timeout)
81 time.sleep(sleeptime)
82 f1 = remote.get_function("rpc.test2.addone")
83 assert f1(10) == 11
84 f1 = remote2.get_function("rpc.test2.addone")
85 assert f1(10) == 11
86
87 except RuntimeError:
88 pass
89 remote3 = tclient.request("abc")
90 f1 = remote3.get_function("rpc.test2.addone")
91 assert f1(10) == 11
92 remote3 = tclient.request("xyz1")
93 f1 = remote3.get_function("rpc.test2.addone")
94 assert f1(10) == 11
95
96 check_timeout(0.01, 0.1)
97 check_timeout(2, 0)

Callers 1

check_server_dropFunction · 0.85

Calls 5

printFunction · 0.85
request_and_runMethod · 0.80
text_summaryMethod · 0.80
requestMethod · 0.45
get_functionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…