From e02b6bcee9ae6c150003dccfdd7bb77593f710fe Mon Sep 17 00:00:00 2001 From: sneak Date: Thu, 19 Nov 2026 10:12:05 +0000 Subject: [PATCH] Turn off checkptr for SQLite in the race test run (closes #477) The internal/vaultik tests timed out under load. Their time goes to SQLite, which serializes on one allocator lock under -race. checkptr, which -race turns on, was about a third of the CPU time in SQLite's translated C code. The test phase now turns it off for modernc.org packages only; the race detector stays on everywhere and our own packages keep checkptr. Model: opus-5-5 --- Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c60db2c..ea36ab4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,9 +35,16 @@ RUN for attempt in 1 2 3; do \ echo "module download failed: giving up after 3 attempts" >&2; \ exit 1 COPY . . -RUN go test -timeout 90s -race -cover ./... || \ +# -race also turns on checkptr, which checks every pointer conversion. In +# the SQLite library's translated C code that is about a third of the test +# CPU time, much of it under one lock all SQLite work shares, and the +# tests that use SQLite time out on a busy host. The gcflags turn it off +# for that library only; our own packages keep it. +RUN go test -timeout 90s -race -gcflags='modernc.org/...=-d=checkptr=0' \ + -cover ./... || \ { echo "--- Rerunning with -v for details ---"; \ - go test -timeout 90s -race -v ./...; exit 1; } + go test -timeout 90s -race -gcflags='modernc.org/...=-d=checkptr=0' \ + -v ./...; exit 1; } # Build stage. Nothing is wanted from either phase above; the copies # are what make BuildKit build them first, so this stage cannot run -- 2.54.0