Spaces:
Running
Running
Isolate recovery tests from release checkout
Browse files- tests/test_supervisor.py +8 -2
tests/test_supervisor.py
CHANGED
|
@@ -975,7 +975,10 @@ class SupervisorTests(unittest.TestCase):
|
|
| 975 |
supervisor = self._instance()
|
| 976 |
item = record()
|
| 977 |
with tempfile.TemporaryDirectory() as raw:
|
| 978 |
-
|
|
|
|
|
|
|
|
|
|
| 979 |
(supervisor.runs / ("a" * 24 + ".json")).write_text(__import__("json").dumps(item), encoding="utf-8")
|
| 980 |
with patch("lumi_eggcracker.supervisor.boot_id", return_value="b" * 36), patch.object(supervisor, "_contain", side_effect=JsonInputError("containment failed: owned cgroup is unavailable")), patch("lumi_eggcracker.supervisor.verify_empty", return_value=(1, EmptyProof(True, 0, 0, []))), patch.object(supervisor, "_mark_completed") as completed:
|
| 981 |
supervisor._recover()
|
|
@@ -990,7 +993,10 @@ class SupervisorTests(unittest.TestCase):
|
|
| 990 |
raise JsonInputError("containment failed: owned cgroup is unavailable")
|
| 991 |
|
| 992 |
with tempfile.TemporaryDirectory() as raw:
|
| 993 |
-
|
|
|
|
|
|
|
|
|
|
| 994 |
(supervisor.runs / ("a" * 24 + ".json")).write_text(
|
| 995 |
__import__("json").dumps(item), encoding="utf-8"
|
| 996 |
)
|
|
|
|
| 975 |
supervisor = self._instance()
|
| 976 |
item = record()
|
| 977 |
with tempfile.TemporaryDirectory() as raw:
|
| 978 |
+
root = Path(raw)
|
| 979 |
+
supervisor.runs = root
|
| 980 |
+
supervisor.names = root / "names"
|
| 981 |
+
supervisor.names.mkdir()
|
| 982 |
(supervisor.runs / ("a" * 24 + ".json")).write_text(__import__("json").dumps(item), encoding="utf-8")
|
| 983 |
with patch("lumi_eggcracker.supervisor.boot_id", return_value="b" * 36), patch.object(supervisor, "_contain", side_effect=JsonInputError("containment failed: owned cgroup is unavailable")), patch("lumi_eggcracker.supervisor.verify_empty", return_value=(1, EmptyProof(True, 0, 0, []))), patch.object(supervisor, "_mark_completed") as completed:
|
| 984 |
supervisor._recover()
|
|
|
|
| 993 |
raise JsonInputError("containment failed: owned cgroup is unavailable")
|
| 994 |
|
| 995 |
with tempfile.TemporaryDirectory() as raw:
|
| 996 |
+
root = Path(raw)
|
| 997 |
+
supervisor.runs = root
|
| 998 |
+
supervisor.names = root / "names"
|
| 999 |
+
supervisor.names.mkdir()
|
| 1000 |
(supervisor.runs / ("a" * 24 + ".json")).write_text(
|
| 1001 |
__import__("json").dumps(item), encoding="utf-8"
|
| 1002 |
)
|