MCPcopy
hub / github.com/ray-project/ray / test_stop

Function test_stop

python/ray/serve/tests/test_haproxy_api.py:1338–1364  ·  view source on GitHub ↗

Test HAProxy stop functionality.

(haproxy_api_cleanup)

Source from the content-addressed store, hash-verified

1336
1337@pytest.mark.asyncio
1338async def test_stop(haproxy_api_cleanup):
1339 """Test HAProxy stop functionality."""
1340 with tempfile.TemporaryDirectory() as temp_dir:
1341 config_file_path = os.path.join(temp_dir, "haproxy.cfg")
1342
1343 config = HAProxyConfig(
1344 http_options=HTTPOptions(
1345 host="127.0.0.1",
1346 port=8000,
1347 ),
1348 stats_port=8404,
1349 socket_path=os.path.join(temp_dir, "admin.sock"),
1350 )
1351
1352 api = HAProxyApi(cfg=config, config_file_path=config_file_path)
1353
1354 haproxy_api_cleanup(api)
1355
1356 # Start HAProxy
1357 await api.start()
1358
1359 haproxy_api_cleanup(api)
1360
1361 await api.stop()
1362
1363 # Verify it's stopped
1364 assert not api._is_running(), "HAProxy should be stopped after shutdown"
1365
1366
1367@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 8

startMethod · 0.95
stopMethod · 0.95
_is_runningMethod · 0.95
HAProxyConfigClass · 0.90
HTTPOptionsClass · 0.90
HAProxyApiClass · 0.90
haproxy_api_cleanupFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…