From 248917c32c536d67241d8445ab37f9f9af3142c8 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 13:34:08 +0000 Subject: populate: the lock's command takes the rest of the journal Journal entries go to the target with the next command populate runs there. A run that failed after noting an entry, but before another command, e.g. at a source delivered on the deploying machine, like a pipe source, lost it, so the next record could miss that the source began to change. The command holding the lock appends the lines of its input to the journal, and unlock gives it the entries no command took yet, before ending its input. The record scenario checks that a run failing at a pipe source leaves the source's begin in the journal. --- pkgs/populate/tests/scenarios.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkgs/populate/tests') diff --git a/pkgs/populate/tests/scenarios.nix b/pkgs/populate/tests/scenarios.nix index 0f1051c..f69217b 100644 --- a/pkgs/populate/tests/scenarios.nix +++ b/pkgs/populate/tests/scenarios.nix @@ -908,6 +908,9 @@ in check = '' cmp "$T"/.populate/run.json "$T".record || fail "record changed" test -e "$T"/.populate/journal || fail "journal missing" + # Also the entry no command after it took to the target. + grep -qxF '{"begin":"y"}' "$T"/.populate/journal || + fail "y's begin missing from the journal" ''; } { -- cgit v1.3.1 [cgit] Unable to lock slot /tmp/cgit/b5200000.lock: Permission denied (13)