feat: add durable success-first modelhub agent
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
import importlib.util
|
||||
import os
|
||||
import unittest
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
@@ -28,6 +29,16 @@ class HostedAgentEntrypointTests(unittest.TestCase):
|
||||
command = ENTRYPOINT._worker_command()
|
||||
|
||||
self.assertEqual(["--max-submits-per-run", "0"], command[-2:])
|
||||
self.assertIn("--state-sync", command)
|
||||
|
||||
def test_readiness_file_is_separate_from_liveness(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as temporary_dir:
|
||||
path = Path(temporary_dir) / "readiness.json"
|
||||
path.write_text('{"ready": false, "reason": "state_sync_unhealthy"}', encoding="utf-8")
|
||||
with patch.object(ENTRYPOINT, "READINESS_PATH", path):
|
||||
readiness = ENTRYPOINT._readiness()
|
||||
self.assertFalse(readiness["ready"])
|
||||
self.assertEqual("state_sync_unhealthy", readiness["reason"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user