mirror of
https://github.com/elder-plinius/OBLITERATUS.git
synced 2026-08-29 22:20:36 +02:00
fix(pipeline): tolerate missing cancellation state
This commit is contained in:
@@ -83,6 +83,7 @@
|
||||
"tests/test_offload_surgery.py",
|
||||
"tests/test_persistence_contracts.py",
|
||||
"tests/test_persistence_pipeline.py",
|
||||
"tests/test_telemetry.py",
|
||||
"tests/conditional/test_cuda_runtime.py",
|
||||
"tests/conditional/test_jetson_runtime.py"
|
||||
]
|
||||
@@ -551,7 +552,8 @@
|
||||
"tests/test_persistence_contracts.py",
|
||||
"tests/test_persistence_pipeline.py",
|
||||
"tests/test_projection_math_contracts.py",
|
||||
"tests/test_offline_integration.py"
|
||||
"tests/test_offline_integration.py",
|
||||
"tests/test_telemetry.py"
|
||||
],
|
||||
"conditional_gates": [
|
||||
"model-download-runtime"
|
||||
|
||||
@@ -1189,8 +1189,9 @@ class AbliterationPipeline:
|
||||
self._cancellation_event.set()
|
||||
|
||||
def _check_cancelled(self, stage: str | None = None) -> None:
|
||||
if self._cancellation_event.is_set():
|
||||
active_stage = stage or self._active_stage
|
||||
cancellation_event = getattr(self, "_cancellation_event", None)
|
||||
if cancellation_event is not None and cancellation_event.is_set():
|
||||
active_stage = stage or getattr(self, "_active_stage", "pipeline")
|
||||
raise PipelineCancelledError(
|
||||
f"Pipeline cancelled during {active_stage.upper()}.",
|
||||
stage=active_stage,
|
||||
|
||||
@@ -297,6 +297,11 @@ class TestPipelineInit:
|
||||
assert pipeline.handle.model is None
|
||||
assert pipeline.handle.tokenizer is None
|
||||
|
||||
def test_cancellation_check_treats_missing_event_as_not_cancelled(self):
|
||||
pipeline = AbliterationPipeline.__new__(AbliterationPipeline)
|
||||
|
||||
pipeline._check_cancelled("verify")
|
||||
|
||||
def test_public_run_cleans_up_terminal_pipeline_failure(self, monkeypatch):
|
||||
from obliteratus.abliterate import PipelineValidationError
|
||||
|
||||
|
||||
Reference in New Issue
Block a user