feat: complete transfer and eviction execution
This commit is contained in:
@@ -120,6 +120,28 @@ class ClientStoreTests(unittest.TestCase):
|
||||
"operation-1", '{"method":2}'
|
||||
)
|
||||
|
||||
def test_job_artifacts_are_immutable_and_survive_restart(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
database = Path(directory) / "state.db"
|
||||
store = ClientStore(database)
|
||||
store.initialize()
|
||||
store.save_job(
|
||||
"job-1", '{"jobId":"job-1"}', "JOB_STATE_RUNNING",
|
||||
1, 0, False,
|
||||
)
|
||||
store.put_job_artifact(
|
||||
"job-1", "baseline", {"selected": [1, 3]}
|
||||
)
|
||||
reopened = ClientStore(database)
|
||||
self.assertEqual(
|
||||
reopened.get_job_artifact("job-1", "baseline")["value"],
|
||||
{"selected": [1, 3]},
|
||||
)
|
||||
with self.assertRaises(JobConflict):
|
||||
reopened.put_job_artifact(
|
||||
"job-1", "baseline", {"selected": [2]}
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user