find the store's files without closing a pipe on find
`find … | head -1` under the driver's pipefail fails when find has another file to write after head has exited: "find: write error: Broken pipe", exit 1. The metrics store's directory now holds enough files for that. find stops itself with -print -quit.
This commit is contained in:
parent
25e59b8d96
commit
42199dfa76
1 changed files with 5 additions and 5 deletions
|
|
@ -502,7 +502,7 @@ pkgs.testers.runNixOSTest {
|
|||
fi
|
||||
kill -TERM "$pid"
|
||||
wait "$pid" || true
|
||||
test -n "$(find ${vlDir} -type f | head -1)"
|
||||
test -n "$(find ${vlDir} -type f -print -quit)"
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
@ -565,7 +565,7 @@ pkgs.testers.runNixOSTest {
|
|||
fi
|
||||
kill -TERM "$pid"
|
||||
wait "$pid" || true
|
||||
test -n "$(find ${vmDir} -type f | head -1)"
|
||||
test -n "$(find ${vmDir} -type f -print -quit)"
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
@ -1166,7 +1166,7 @@ pkgs.testers.runNixOSTest {
|
|||
pvc = json.loads(kube(machine, f"get pvc {VL}-store -o json"))
|
||||
assert pvc["status"]["phase"] == "Bound" and pvc["spec"]["volumeName"] == pv["metadata"]["name"], pvc
|
||||
assert machine.succeed(f"stat -c %g {VL_DIR}").strip() == "65532"
|
||||
assert machine.succeed(f"find {VL_DIR} -type f -user ${legacyUser} | head -1").strip() != ""
|
||||
assert machine.succeed(f"find {VL_DIR} -type f -user ${legacyUser} -print -quit").strip() != ""
|
||||
assert machine.succeed(f"kubectl -n {NS} get pods {vl_pod} -o jsonpath='{{.status.containerStatuses[0].restartCount}}'").strip() == "0"
|
||||
|
||||
def vl_request(path: str, token: str | None, *args: str) -> tuple[int, str]:
|
||||
|
|
@ -1528,7 +1528,7 @@ pkgs.testers.runNixOSTest {
|
|||
pvc = json.loads(kube(machine, f"get pvc {VM}-store -o json"))
|
||||
assert pvc["status"]["phase"] == "Bound" and pvc["spec"]["volumeName"] == pv["metadata"]["name"], pvc
|
||||
assert machine.succeed(f"stat -c %g {VM_DIR}").strip() == "65532"
|
||||
assert machine.succeed(f"find {VM_DIR} -type f -user ${legacyVmUser} | head -1").strip() != ""
|
||||
assert machine.succeed(f"find {VM_DIR} -type f -user ${legacyVmUser} -print -quit").strip() != ""
|
||||
status = json.loads(kube(machine, f"get pod {vm_pod} -o json"))
|
||||
assert status["spec"]["containers"][0]["startupProbe"]["failureThreshold"] == 60, status["spec"]
|
||||
container = status["status"]["containerStatuses"][0]
|
||||
|
|
@ -1812,7 +1812,7 @@ pkgs.testers.runNixOSTest {
|
|||
pvc = json.loads(kube(machine, f"get pvc {GRAFANA}-store -o json"))
|
||||
assert pvc["status"]["phase"] == "Bound" and pvc["spec"]["volumeName"] == pv["metadata"]["name"], pvc
|
||||
assert machine.succeed(f"stat -c %g {GRAFANA_DIR}").strip() == "65532"
|
||||
assert machine.succeed(f"find {GRAFANA_DIR} -name grafana.db -user ${legacyGrafanaUser} | head -1").strip() != ""
|
||||
assert machine.succeed(f"find {GRAFANA_DIR} -name grafana.db -user ${legacyGrafanaUser} -print -quit").strip() != ""
|
||||
status = json.loads(kube(machine, f"get pod {grafana_pod} -o json"))
|
||||
main = next(c for c in status["spec"]["containers"] if c["name"] == GRAFANA)
|
||||
assert main["startupProbe"]["failureThreshold"] == 30, main
|
||||
|
|
|
|||
Loading…
Reference in a new issue