Make the load-sensitive tests wait for what they check (closes #507)
check / check (push) Successful in 10m37s
check / check (push) Successful in 10m37s
The browser test waits for each page a click opens to load, and for Alpine.js to start on it, before reading that page; before, a read could find an element of the page being left. The delivery tests' drain takes what is queued without a timer. The dispatch paths queue before they return, and the 25 ms timer could be due by the time select looked, which then chose at random between it and a queued task. The test phase keeps the tests' temporary directories, and with them their SQLite databases, on a tmpfs: waiting for the disk at each commit was about 40% of internal/handlers' run time on a busy host. Model: opus-5-5
This commit is contained in:
+8
-1
@@ -147,9 +147,16 @@ RUN script/assets
|
||||
# shown in full, so there is nothing to rerun. The step fails after the rerun
|
||||
# whatever its result: the first run already showed the suite is broken.
|
||||
#
|
||||
# TMPDIR, where the tests keep their SQLite databases, is a tmpfs: SQLite
|
||||
# waits for the disk at every commit, and on a busy host that waiting was
|
||||
# about 40% of the slowest package's run time. GOTMPDIR keeps go's own
|
||||
# build files, the test binaries among them, on disk.
|
||||
#
|
||||
# bash with pipefail, so that the first run's status is go test's, not tee's.
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN go test -race -cover -p 4 -parallel 8 -timeout 90s ./... 2>&1 | tee /tmp/go-test.log && exit 0; \
|
||||
RUN --mount=type=tmpfs,target=/tmp/tests,size=512m \
|
||||
export TMPDIR=/tmp/tests GOTMPDIR=/tmp; \
|
||||
go test -race -cover -p 4 -parallel 8 -timeout 90s ./... 2>&1 | tee /tmp/go-test.log && exit 0; \
|
||||
tests="$(awk '/^--- FAIL: / { print $3 }' /tmp/go-test.log | paste -s -d '|' -)"; \
|
||||
packages="$(awk '/^FAIL\t/ { print $2 }' /tmp/go-test.log)"; \
|
||||
if [ -n "$tests" ]; then \
|
||||
|
||||
Reference in New Issue
Block a user