Unverified Commit 41826340 authored by Morgan Jones's avatar Morgan Jones
Browse files

yubihsm-shell: fix checkPhase race condition

This passed locally but failed on hydra, guess my machine was too fast.
parent f0785b7e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -94,6 +94,12 @@ stdenv.mkDerivation (finalAttrs: {
    # so we expect a failure here, but it should at least try to connect
    yubihsm-connector -d </dev/null 1>&2 2>connector.log &
    yubihsm_pid=$!
    idx=0
    while ! grep takeoff connector.log >/dev/null && [ $idx -lt 10 ]; do
      idx=$((idx+1))
      echo "Waiting for yubihsm-connector startup (try: $idx)" >&2
      sleep 1
    done
    $out/bin/yubihsm-shell -Pv1 </dev/null || true
    kill -INT "$yubihsm_pid" && { wait "$yubihsm_pid" || true; }
    cat connector.log >&2