Compare commits
2 Commits
7f27362d42
...
22c1130cf0
| Author | SHA1 | Date | |
|---|---|---|---|
| 22c1130cf0 | |||
| a55b6f4e55 |
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: Repository Policies
|
title: Repository Policies
|
||||||
last_modified: 2026-07-06
|
last_modified: 2026-08-07
|
||||||
---
|
---
|
||||||
|
|
||||||
This document covers repository structure, tooling, and workflow standards. Code
|
This document covers repository structure, tooling, and workflow standards. Code
|
||||||
@@ -189,8 +189,13 @@ style conventions are in separate documents:
|
|||||||
module under test to verify it compiles/parses. There is no excuse for
|
module under test to verify it compiles/parses. There is no excuse for
|
||||||
`make test` to be a no-op.
|
`make test` to be a no-op.
|
||||||
|
|
||||||
- `make test` must complete in under 20 seconds. Add a 30-second timeout in the
|
- `make test` must complete in under 60 seconds. That is the hard cap, and a
|
||||||
Makefile.
|
suite that exceeds it fails. Under 20 seconds is the target. A suite between
|
||||||
|
20 and 60 seconds is still green, but the overage must be filed as an
|
||||||
|
improvement bug against that repo. Add a 90-second timeout to the test
|
||||||
|
invocation in the Makefile (`go test -timeout 90s`). The backstop deliberately
|
||||||
|
sits above the hard cap so that it catches a genuinely hung test rather than a
|
||||||
|
merely slow one.
|
||||||
|
|
||||||
- **`make test` should use the conditional verbose rerun pattern.** Run tests
|
- **`make test` should use the conditional verbose rerun pattern.** Run tests
|
||||||
without `-v` (verbose) first. If tests fail, automatically rerun with `-v` to
|
without `-v` (verbose) first. If tests fail, automatically rerun with `-v` to
|
||||||
@@ -209,9 +214,9 @@ style conventions are in separate documents:
|
|||||||
|
|
||||||
```makefile
|
```makefile
|
||||||
test:
|
test:
|
||||||
@go test -timeout 30s -race -cover ./... || \
|
@go test -timeout 90s -race -cover ./... || \
|
||||||
{ echo "--- Rerunning with -v for details ---"; \
|
{ echo "--- Rerunning with -v for details ---"; \
|
||||||
go test -timeout 30s -race -v ./...; exit 1; }
|
go test -timeout 90s -race -v ./...; exit 1; }
|
||||||
```
|
```
|
||||||
|
|
||||||
Python example:
|
Python example:
|
||||||
@@ -260,7 +265,10 @@ style conventions are in separate documents:
|
|||||||
|
|
||||||
- `.golangci.yml` is standardized and must _NEVER_ be modified by an agent, only
|
- `.golangci.yml` is standardized and must _NEVER_ be modified by an agent, only
|
||||||
manually by the user. Fetch from
|
manually by the user. Fetch from
|
||||||
`https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml`.
|
`https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml`. The
|
||||||
|
canonical golangci-lint version is v2.12.2 (released 2026-05-06), installed
|
||||||
|
commit-pinned via
|
||||||
|
`go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@c0d3ddc9cf3faa61a4e378e879ece580256d76e5`.
|
||||||
|
|
||||||
- When pinning images or packages by hash, add a comment above the reference
|
- When pinning images or packages by hash, add a comment above the reference
|
||||||
with the version and date (YYYY-MM-DD).
|
with the version and date (YYYY-MM-DD).
|
||||||
|
|||||||
24
script/test
24
script/test
@@ -1,12 +1,34 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# script/test: run the test suite.
|
# script/test: run the test suite.
|
||||||
|
#
|
||||||
|
# -timeout is applied by `go test` per package, not to the run as a whole, so
|
||||||
|
# it only has to clear the slowest single package. That is internal/handlers,
|
||||||
|
# measured in a cache-defeated builder stage on the 48-core shared build host
|
||||||
|
# (2026-08-18, this tree):
|
||||||
|
#
|
||||||
|
# 16.9s host load 5-20, GOMAXPROCS 48
|
||||||
|
# 45.9s / 47.3s / 49.0s three runs at deliberate host load 31-73
|
||||||
|
# 30.6s / 39.7s host load 5-20, GOMAXPROCS 6 / 4
|
||||||
|
# 67.3s / 97.5s host load 5-20, GOMAXPROCS 2 / 1
|
||||||
|
# 67.3s GOMAXPROCS 4 at deliberate host load 52-68
|
||||||
|
#
|
||||||
|
# The old 30s budget was breached by every loaded run and by every GOMAXPROCS
|
||||||
|
# at or below 6; at GOMAXPROCS 4 it failed outright ("panic: test timed out
|
||||||
|
# after 30s"), reproduced on 33e4fa4 with no other change.
|
||||||
|
#
|
||||||
|
# 90s matches the org-wide backstop in REPO_POLICIES.md and is sized here
|
||||||
|
# against the figures above: the worst case under native parallelism is 49.0s,
|
||||||
|
# and the compound GOMAXPROCS-4-under-load case at 67.3s sits at 75% of it.
|
||||||
|
# The rows above 90s come from GOMAXPROCS 1 and 2, a synthetic core floor
|
||||||
|
# rather than a condition CI runs under. If a CPU-limited runner ever puts a
|
||||||
|
# real run near 67s, that is the datum to revisit the org figure with.
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
cd "$ROOT"
|
cd "$ROOT"
|
||||||
go test -v -race -timeout 30s ./...
|
go test -v -race -timeout 90s ./...
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user