mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-04 15:28:27 +01:00
fix: #8612 For checkpoint experiment in some case users might want to give it a early stopping to reduce variance. But currently if we interrupt/kill the experiment it will be marked as failed, and all of the completed checkpoints will be removed as we cleanup all the running directly after the process failed. 1. We raise CheckpointKilledError intead of StageCmdFailed error if at least one checkpoint had been commited. 2. Temp_dir executor will continue collecting data if the Checkpoint stage was interrupted. 3. Raise warnings if a checkpoint stage was incomplete and the other stages were not forwarded. 4. Add a new functional test for this
43 lines
1.1 KiB
Python
43 lines
1.1 KiB
Python
import pytest
|
|
|
|
from tests.unit.repo.experiments.conftest import ( # noqa, pylint disable=unused-argument
|
|
checkpoint_stage,
|
|
exp_stage,
|
|
failed_checkpoint_stage,
|
|
failed_exp_stage,
|
|
test_queue,
|
|
)
|
|
|
|
|
|
@pytest.fixture
|
|
def http_auth_patch(mocker):
|
|
from dulwich.client import HTTPUnauthorized
|
|
|
|
url = "https://0.0.0.0"
|
|
client = mocker.MagicMock()
|
|
client.get_refs.side_effect = HTTPUnauthorized("", url)
|
|
client.send_pack.side_effect = HTTPUnauthorized("", url)
|
|
|
|
patch = mocker.patch("dulwich.client.get_transport_and_path")
|
|
patch.return_value = (client, url)
|
|
return url
|
|
|
|
|
|
@pytest.fixture(params=[True, False])
|
|
def workspace(request, test_queue) -> bool: # noqa
|
|
return request.param
|
|
|
|
|
|
@pytest.fixture
|
|
def params_repo(tmp_dir, scm, dvc):
|
|
(tmp_dir / "params.yaml").dump(
|
|
{"foo": [{"bar": 1}, {"baz": 2}], "goo": {"bag": 3.0}, "lorem": False}
|
|
)
|
|
dvc.run(
|
|
cmd="echo foo",
|
|
params=["params.yaml:"],
|
|
name="foo",
|
|
)
|
|
scm.add(["dvc.yaml", "dvc.lock", "copy.py", "params.yaml"])
|
|
scm.commit("init")
|