MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / test_timeout_error

Method test_timeout_error

tests/unittest/executor/test_rpc.py:338–359  ·  view source on GitHub ↗

Test that requests that exceed timeout are handled with proper error.

(self)

Source from the content-addressed store, hash-verified

336
337 @pytest.mark.skip(reason="This test is flaky, need to fix it")
338 def test_timeout_error(self):
339 """Test that requests that exceed timeout are handled with proper error."""
340
341 class App:
342
343 def slow_method(self):
344 # Sleep longer than the timeout
345 time.sleep(2.0)
346 return "completed"
347
348 with RpcServerWrapper(App()) as server:
349 time.sleep(0.1)
350
351 # Create client with short timeout
352 with RPCClient(server.addr, timeout=0.5) as client:
353 with pytest.raises(RPCError) as exc_info:
354 client.slow_method().remote(timeout=0.5)
355
356 error = exc_info.value
357 # Should be either a timeout error or RPC error indicating timeout
358 assert "timed out" in str(error).lower() or "timeout" in str(
359 error).lower()
360
361 def test_method_not_found_error(self):
362 """Test that calling non-existent methods returns proper error."""

Callers

nothing calls this directly

Calls 6

RPCClientClass · 0.90
RpcServerWrapperClass · 0.85
sleepMethod · 0.80
remoteMethod · 0.80
slow_methodMethod · 0.80
AppClass · 0.70

Tested by

no test coverage detected