package api import ( "os" "testing" "github.com/loyaly/behavision-server/internal/auth" ) // The whole package runs at bcrypt's minimum cost. // // Almost every test here signs in, and at the production cost of 12 that is // ~500 ms of hashing per test for a hash and a verify. Under the race detector // that pushed this package past `go test`'s ten-minute default - a CI failure // with no failing assertion in it, which is the worst kind to debug. // // What this does NOT weaken: the tests that care about hashing care about // whether two paths take the SAME time as each other, not how long either // takes. Lowering both sides equally leaves that intact. func TestMain(m *testing.M) { restore := auth.UseTestCost() code := m.Run() restore() os.Exit(code) }