Skip to content

feat(coderd): return agent script timings #14923

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 18 commits into from
Oct 14, 2024
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
Wait long
  • Loading branch information
BrunoQuaresma committed Oct 4, 2024
commit a846eb7514b4a299d74cfc0e289612c979935b2a
14 changes: 7 additions & 7 deletions coderd/workspacebuilds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestWorkspaceBuild(t *testing.T) {
propagation.Baggage{},
),
)
ctx := testutil.Context(t, testutil.WaitShort)
ctx := testutil.Context(t, testutil.WaitLong)
auditor := audit.NewMock()
client, db := coderdtest.NewWithDatabase(t, &coderdtest.Options{
IncludeProvisionerDaemon: true,
Expand Down Expand Up @@ -1244,7 +1244,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {

// When: fetching an inexistent build
buildID := uuid.New()
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
t.Cleanup(cancel)
_, err := client.WorkspaceBuildTimings(ctx, buildID)

Expand All @@ -1258,7 +1258,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {

// When: fetching timings for a build with no timings
build := makeBuild()
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
t.Cleanup(cancel)
res, err := client.WorkspaceBuildTimings(ctx, build.ID)

Expand All @@ -1276,7 +1276,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {
provisionerTimings := dbgen.ProvisionerJobTimings(t, db, build, 5)

// Then: return a response with the expected timings
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
t.Cleanup(cancel)
res, err := client.WorkspaceBuildTimings(ctx, build.ID)
require.NoError(t, err)
Expand Down Expand Up @@ -1312,7 +1312,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {
agentScriptTimings := dbgen.WorkspaceAgentScriptTimings(t, db, script, 5)

// Then: return a response with the expected timings
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
t.Cleanup(cancel)
res, err := client.WorkspaceBuildTimings(ctx, build.ID)
require.NoError(t, err)
Expand Down Expand Up @@ -1342,7 +1342,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {
})

// Then: return a response with empty agent script timings
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
t.Cleanup(cancel)
res, err := client.WorkspaceBuildTimings(ctx, build.ID)
require.NoError(t, err)
Expand All @@ -1360,7 +1360,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {
})

// Then: return a response with empty agent script timings
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
t.Cleanup(cancel)
res, err := client.WorkspaceBuildTimings(ctx, build.ID)
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions coderd/workspaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3642,7 +3642,7 @@ func TestWorkspaceTimings(t *testing.T) {
dbgen.WorkspaceAgentScriptTimings(t, db, script, 3)

// When: fetching the timings
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
t.Cleanup(cancel)
res, err := client.WorkspaceTimings(ctx, ws.ID)

Expand All @@ -3657,7 +3657,7 @@ func TestWorkspaceTimings(t *testing.T) {

// When: fetching an inexistent workspace
workspaceID := uuid.New()
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
t.Cleanup(cancel)
_, err := client.WorkspaceTimings(ctx, workspaceID)

Expand Down
Loading