From 429d54e146c2d14e8aaa18d0e3f57066f8e88432 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Thu, 10 Jun 2021 11:53:51 +0300 Subject: [PATCH] stage: monitor: don't forget to unprotect outs (#6134) Fixes #6083 --- dvc/stage/monitor.py | 1 + tests/func/experiments/test_checkpoints.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dvc/stage/monitor.py b/dvc/stage/monitor.py index db6e16d5b..9461c6022 100644 --- a/dvc/stage/monitor.py +++ b/dvc/stage/monitor.py @@ -75,6 +75,7 @@ class CheckpointTask(MonitorTask): def _run_callback(stage, callback_func): stage.save(allow_missing=True) stage.commit(allow_missing=True) + stage.unprotect_outs() logger.debug("Running checkpoint callback for stage '%s'", stage) callback_func() diff --git a/tests/func/experiments/test_checkpoints.py b/tests/func/experiments/test_checkpoints.py index 6f1ebf7f0..02c93cd14 100644 --- a/tests/func/experiments/test_checkpoints.py +++ b/tests/func/experiments/test_checkpoints.py @@ -7,9 +7,13 @@ from dvc.repo.experiments.base import EXEC_APPLY, EXEC_CHECKPOINT @pytest.mark.parametrize("workspace", [True, False]) +@pytest.mark.parametrize("links", ["reflink,copy", "hardlink,symlink"]) def test_new_checkpoint( - tmp_dir, scm, dvc, checkpoint_stage, mocker, workspace + tmp_dir, scm, dvc, checkpoint_stage, mocker, workspace, links ): + with dvc.config.edit() as conf: + conf["cache"]["type"] = links + new_mock = mocker.spy(dvc.experiments, "new") results = dvc.experiments.run( checkpoint_stage.addressing, params=["foo=2"], tmp_dir=not workspace