lol

nixos/tests/gitdaemon: deflake by using systemd-tmpfiles

git-daemon won't start up if its project directory (here /git) doesn't
exist. If we try to create it using the test harness, then we're racing
whether we manage to connect to the backdoor vs. the startup speed of
git-daemon.

Instead, use systemd-tmpfiles, which is guaranteed(?) to run before
network.target and thus before git-daemon.service starts.

+5 -1
+5 -1
nixos/tests/gitdaemon.nix
··· 18 18 19 19 environment.systemPackages = [ pkgs.git ]; 20 20 21 + systemd.tmpfiles.rules = [ 22 + # type path mode user group age arg 23 + " d /git 0755 root root - -" 24 + ]; 25 + 21 26 services.gitDaemon = { 22 27 enable = true; 23 28 basePath = "/git"; ··· 35 40 36 41 with subtest("create project.git"): 37 42 server.succeed( 38 - "mkdir /git", 39 43 "git init --bare /git/project.git", 40 44 "touch /git/project.git/git-daemon-export-ok", 41 45 )