all: fix test flakiness and improve test infrastructure
Buffer the AuthRequest verdict channel to prevent a race where the sender blocks indefinitely if the receiver has already timed out, and increase the auth followup test timeout from 100ms to 5s to prevent spurious failures under load. Skip postgres-backed tests when the postgres server is unavailable instead of calling t.Fatal, which was preventing the rest of the test suite from running. Add TestMain to db, types, and policy/v2 packages to chdir to the source directory before running tests. This ensures relative testdata/ paths resolve correctly when the test binary is executed from an arbitrary working directory (e.g., via "go tool stress").
This commit is contained in:
parent
fffc58b5d0
commit
3e0a96ec3a
6 changed files with 79 additions and 4 deletions
|
|
@ -56,7 +56,7 @@ func newPostgresDBForTest(t *testing.T) *url.URL {
|
|||
|
||||
srv, err := postgrestest.Start(ctx)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
t.Skipf("start postgres: %s", err)
|
||||
}
|
||||
|
||||
t.Cleanup(srv.Cleanup)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue