Spend less of make test writing the image and waiting (closes #56)
check / check (push) Failing after 2s

The test phase spends most of its time compiling with the race
detector from an empty build cache; then come writing the test image
and the internal/proxy tests.

- Go's build cache is on a tmpfs in the test phase, so its 137 MB are
  no longer written into the test image.
- TestUpgradedConnectionOutlastsTheTimeouts waits until just past
  shortTimeout after the request was sent, rather than 7.5 s after the
  upgrade, so it ends with the other timing tests.
- shortTimeout is written as waitLimit / 2, as its comment says it is.

Model: opus-5-5
This commit is contained in:
2026-10-04 08:19:19 +00:00
parent d4f90dba37
commit b8edfcec37
3 changed files with 12 additions and 7 deletions
+4 -1
View File
@@ -29,7 +29,10 @@ RUN go mod download
COPY . .
RUN go test -count=1 -timeout 90s -race -cover ./... || \
# Go's build cache is kept on a tmpfs, out of the image: nothing uses it
# after this step, and writing it into the image takes seconds.
RUN --mount=type=tmpfs,target=/root/.cache/go-build \
go test -count=1 -timeout 90s -race -cover ./... || \
{ echo "--- Rerunning with -v for details ---"; \
go test -count=1 -timeout 90s -race -v ./...; exit 1; }