1 Incheckningar
Upphovsman SHA1 Meddelande Datum
sneak c81d381135 Skip the verbose test rerun after a timeout (closes #61)
check / check (push) Waiting to run
A hung test used the 90-second backstop twice, because the verbose
rerun waited for the same hang. The Go recipe now looks in the first
run's output for the lines Go prints for a hang, and exits 1 with no
rerun. A failure with neither line in its output still reruns with -v.

The Python make test example takes the same timeout wrapper as its
Dockerfile example. The 60 and 90 second rule and the 5-minute rule say
a hung package uses the backstop once. The Go item in both repo
checklists now asks for this.

Model: opus-5-5
2026-11-03 21:42:23 +00:00
4 ändrade filer med 24 tillägg och 18 borttagningar
+3 -2
Visa fil
@@ -28,8 +28,9 @@ fmt-check, and commit.
`panic: test timed out` or `*** Test killed`, and exits 1 when either is
there. The Python `make test` example takes the same `timeout 90 sh -c`
wrapper as its `Dockerfile` example. The 60 and 90 second rule and the
5-minute rule now say a hung package uses the backstop once. Consuming
repositories pick this up on their next re-vendor.
5-minute rule now say a hung package uses the backstop once. The Go item in
both repo checklists now asks for this, so a repository with the old recipe
fails it.
- 2026-10-27: Added `prompts/API_POLICIES.md`
(https://git.eeqj.de/sneak/prompts/issues/137). It holds sneak's rule from
https://git.eeqj.de/sneak/routewatch/issues/199 that a value in an API
+4 -3
Visa fil
@@ -1,6 +1,6 @@
---
title: Existing Repo Checklist
last_modified: 2026-10-26
last_modified: 2026-11-03
---
Use this checklist when beginning work in a repo that may not yet conform to our
@@ -70,8 +70,9 @@ with your task.
(`--mount=type=cache,target=/root/.cache/go-build`), `golangci-lint run`
also mounts golangci-lint's
(`--mount=type=cache,target=/root/.cache/golangci-lint`), and no step
mounts anything else; both `go test` runs carry `-count=1`, as in the
canonical Go `Dockerfile` in `REPO_POLICIES.md`
mounts anything else; both `go test` runs carry `-count=1`; a first run
that timed out gets no rerun, as in the canonical Go `Dockerfile` in
`REPO_POLICIES.md`
- [ ] Python: a `test` phase that installs its packages from `Pipfile.lock` does
it above `ARG CACHEBUST`, with `COPY script/ script/`,
`COPY Pipfile Pipfile.lock ./` and `RUN script/bootstrap`. When
+4 -3
Visa fil
@@ -1,6 +1,6 @@
---
title: New Repo Checklist
last_modified: 2026-10-26
last_modified: 2026-11-03
---
Use this checklist when creating a new repository from scratch. Follow the steps
@@ -129,8 +129,9 @@ Template files can be fetched from:
(`--mount=type=cache,target=/root/.cache/go-build`), `golangci-lint run`
also mounts golangci-lint's
(`--mount=type=cache,target=/root/.cache/golangci-lint`), and no step
mounts anything else; both `go test` runs carry `-count=1`, as in the
canonical Go `Dockerfile` in `REPO_POLICIES.md`
mounts anything else; both `go test` runs carry `-count=1`; a first run
that timed out gets no rerun, as in the canonical Go `Dockerfile` in
`REPO_POLICIES.md`
- Python: a `test` phase that installs its packages from `Pipfile.lock` does
it above `ARG CACHEBUST`, with `COPY script/ script/`,
`COPY Pipfile Pipfile.lock ./` and `RUN script/bootstrap`. When
+13 -10
Visa fil
@@ -233,7 +233,8 @@ style conventions are in separate documents:
# Test phase. -race needs cgo and so a C compiler, which the Debian Go
# image ships and the alpine one does not. -count=1 because the mounted
# cache also holds test results, which go test would otherwise replay.
# A first run that timed out gets no rerun: its output has the stacks.
# A first run that timed out gets no rerun, because a rerun would only
# wait for the same hang.
# golang:1.x, YYYY-MM-DD
FROM golang@sha256:... AS test
WORKDIR /src
@@ -242,8 +243,8 @@ style conventions are in separate documents:
ARG CACHEBUST
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
output=$(go test -count=1 -timeout 90s -race -cover ./... 2>&1); \
status=$?; \
status=0; \
output=$(go test -count=1 -timeout 90s -race -cover ./... 2>&1) || status=$?; \
printf '%s\n' "$output"; \
test "$status" -eq 0 && exit 0; \
case "$output" in \
@@ -510,8 +511,7 @@ style conventions are in separate documents:
```makefile
test:
@<test-command> || \
{ <exit 1 if that run timed out>; \
echo "--- Rerunning with -v for details ---"; \
{ echo "--- Rerunning with -v for details ---"; \
<test-command-with-v>; exit 1; }
```
@@ -519,8 +519,8 @@ style conventions are in separate documents:
```makefile
test:
@output=$$(go test -count=1 -timeout 90s -race -cover ./... 2>&1); \
status=$$?; \
@status=0; \
output=$$(go test -count=1 -timeout 90s -race -cover ./... 2>&1) || status=$$?; \
printf '%s\n' "$$output"; \
test "$$status" -eq 0 && exit 0; \
case "$$output" in \
@@ -539,8 +539,8 @@ style conventions are in separate documents:
Go prints the goroutine stacks with either line, as long as the test can
still respond. A rerun would only wait for the same hang, so the recipe
exits 1. Any other failure reruns with `-v`. The kept output prints when the
first run ends, not while it runs.
exits 1. A failure with neither line in its output reruns with `-v`. The
kept output prints when the first run ends, not while it runs.
`-count=1` is required on both invocations: it defeats Go's test _result_
cache, so neither run can report a stored pass in place of running the
@@ -566,7 +566,10 @@ style conventions are in separate documents:
```
Both pytest runs share that one 90-second timeout, as in the `Dockerfile`
example above, so a hang uses it once and gets no rerun.
example above, so a hang uses it once and gets no rerun. Ctrl-C does not
stop a running `make test`, which goes on until the tests end or the 90
seconds run out. On a Mac without `timeout`, the target fails until it is
installed.
The `exit 1` ensures the target always fails after a rerun — the first run
already proved the tests are broken, so the build must not pass even if a