Skip to content

chore: Use standardized test timeouts and delays #3291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix cases caught by linter
  • Loading branch information
mafredri committed Jul 29, 2022
commit f1fb0af795833bb91beb1b419c9a58a5f92d718f
4 changes: 2 additions & 2 deletions cli/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package cli_test
import (
"context"
"testing"
"time"

"github.com/stretchr/testify/assert"

"github.com/coder/coder/cli/clitest"
"github.com/coder/coder/coderd/coderdtest"
"github.com/coder/coder/internal/testutil"
"github.com/coder/coder/pty/ptytest"
)

Expand All @@ -29,7 +29,7 @@ func TestList(t *testing.T) {
cmd.SetIn(pty.Input())
cmd.SetOut(pty.Output())

ctx, cancelFunc := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitLong)
defer cancelFunc()
done := make(chan any)
go func() {
Expand Down
2 changes: 1 addition & 1 deletion cli/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func TestServer(t *testing.T) {
},
},
}
_, err = client.HasFirstUser(ctx)
_, err := client.HasFirstUser(ctx)
require.NoError(t, err)

cancelFunc()
Expand Down
3 changes: 2 additions & 1 deletion coderd/provisionerjobs_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/internal/testutil"
)

func TestProvisionerJobLogs_Unit(t *testing.T) {
Expand Down Expand Up @@ -63,7 +64,7 @@ func TestProvisionerJobLogs_Unit(t *testing.T) {
{ID: uuid.New(), JobID: jobID, Stage: "Stage3"},
}

ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
defer cancel()

// wow there are a lot of DB rows we touch...
Expand Down