mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
fix: Move timeout ctx closer to use in tests, increase timeout (#3109)
Some contexts were moved closer to use so that test setup doesn't affect timeout. And timeout was increased for some others to avoid flakyness due to slow test runners.
This commit is contained in:
committed by
GitHub
parent
e874d538fb
commit
ef7d357e19
@ -27,8 +27,6 @@ func TestProvisionerJobLogs_Unit(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
t.Run("QueryPubSubDupes", func(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
t.Cleanup(cancel)
|
||||
logger := slogtest.Make(t, nil).Leveled(slog.LevelDebug)
|
||||
// mDB := mocks.NewStore(t)
|
||||
fDB := databasefake.New()
|
||||
@ -65,6 +63,9 @@ func TestProvisionerJobLogs_Unit(t *testing.T) {
|
||||
{ID: uuid.New(), JobID: jobID, Stage: "Stage3"},
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
|
||||
// wow there are a lot of DB rows we touch...
|
||||
_, err = fDB.InsertAPIKey(ctx, database.InsertAPIKeyParams{
|
||||
ID: keyID,
|
||||
|
Reference in New Issue
Block a user