MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / test_server_wait_timeout_no_server

Function test_server_wait_timeout_no_server

tests/test_server.py:283–293  ·  view source on GitHub ↗

Test that 'hq server wait' times out when no server is running

(hq_env: HqEnv, tmp_path)

Source from the content-addressed store, hash-verified

281
282
283def test_server_wait_timeout_no_server(hq_env: HqEnv, tmp_path):
284 """Test that 'hq server wait' times out when no server is running"""
285 start_time = time.time()
286
287 with pytest.raises(Exception, match=r"Timeout after 2s.*Could not connect to server"):
288 hq_env.command(["server", "wait", "--timeout", "2s", "--server-dir", str(tmp_path)], use_server_dir=False)
289
290 elapsed = time.time() - start_time
291
292 # Should timeout after roughly 2 seconds (allow some tolerance)
293 assert 1.5 < elapsed < 4.0
294
295
296def test_server_wait_success_immediate(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 2

timeMethod · 0.80
commandMethod · 0.80

Tested by

no test coverage detected