Keep make test under 2 GB of memory (closes #344)
check / check (push) Successful in 5m40s

Every test that starts a database hashed the bootstrap admin password
with Argon2id at 64 MB, which under -race holds about 150 MB per hash,
across dozens of parallel tests. The test packages that hash now lower
the memory cost to 1 MB from TestMain. One test still hashes and
verifies at the shipped parameters, which are unchanged.

script/test also runs at most four packages and eight parallel tests
at once: unbounded, a many-core host linked and ran every test binary
together.

Model: opus-5-5
This commit is contained in:
2026-10-01 19:49:01 +00:00
parent 507980a347
commit 0a112fad71
11 changed files with 145 additions and 3 deletions
+14
View File
@@ -0,0 +1,14 @@
package resetpw_test
import (
"testing"
"sneak.berlin/go/webhooker/internal/database"
)
// TestMain lowers the password hashing cost before any test runs. See
// database.LowerPasswordHashCostForTest.
func TestMain(m *testing.M) {
database.LowerPasswordHashCostForTest()
m.Run()
}