Commit d4b989ca authored by Bjørn Forsman's avatar Bjørn Forsman
Browse files

nixos/deconz: delay signalling service readiness until it's actually up

Fixes test flakiness (`nix-build -A nixosTests.deconz`).
parent fd0b14a6
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -93,6 +93,13 @@ in
        # be garbage collected. Ensure the file gets "refreshed" on every start.
        rm -f ${stateDir}/.local/share/dresden-elektronik/deCONZ/zcldb.txt
      '';
      postStart = ''
        # Delay signalling service readiness until it's actually up.
        while ! "${lib.getExe pkgs.curl}" -sSfl -o /dev/null "http://${cfg.listenAddress}:${toString cfg.httpPort}"; do
            echo "Waiting for TCP port ${toString cfg.httpPort} to be open..."
            sleep 1
        done
      '';
      environment = {
        HOME = stateDir;
        XDG_RUNTIME_DIR = "/run/${name}";