- Tests hash passwords at bcrypt.MinCost through db.PasswordCost. - Test IRC servers check the queue only on broker notification; one test keeps the 100 ms fallback poll. - The stop-timeout test shortens the timeout through a test-only setter. - service and handlers tests build config.Config directly instead of through config.New, so they run in parallel: service had run serially, and handlers started its servers one at a time. - Repeated race trials run as parallel subtests. - Fixed sleeps become waits on the broker. - A new test covers the relay's failed queue read, which only the 100 ms poll had reached. Model: opus-5-5
This commit is contained in:
1 parent
bc8aa6bb96
commit
c492e5969e
11 files changed
+356
-198
No files matched your search
@@ -10,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"go.uber.org/fx/fxtest"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
"sneak.berlin/go/neoirc/internal/config"
|
||||
"sneak.berlin/go/neoirc/internal/db"
|
||||
"sneak.berlin/go/neoirc/internal/dbtest"
|
||||
@@ -29,6 +30,13 @@ const (
|
||||
endlessQueryTimeout = 100 * time.Millisecond
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
// A password hashed at full cost takes seconds under -race.
|
||||
db.PasswordCost = bcrypt.MinCost
|
||||
|
||||
m.Run()
|
||||
}
|
||||
|
||||
// TestDefaultDBURLSetsWALAndBusyTimeout opens a file database
|
||||
// with the default URL's parameters the way the server does,
|
||||
// and checks the journal mode and busy timeout it ends up with.
|
||||
|
||||
Reference in new issue
Block a user