mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
test: Fix test timeouts due to contexts created too early (#7242)
This commit is contained in:
committed by
GitHub
parent
ea78ca5dff
commit
6f06f8dadb
@ -572,8 +572,7 @@ func TestWorkspaceBuildState(t *testing.T) {
|
||||
|
||||
func TestWorkspaceBuildStatus(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
|
||||
defer cancel()
|
||||
|
||||
auditor := audit.NewMock()
|
||||
numLogs := len(auditor.AuditLogs())
|
||||
client, closeDaemon, api := coderdtest.NewWithAPI(t, &coderdtest.Options{IncludeProvisionerDaemon: true, Auditor: auditor})
|
||||
@ -597,6 +596,10 @@ func TestWorkspaceBuildStatus(t *testing.T) {
|
||||
closeDaemon = coderdtest.NewProvisionerDaemon(t, api)
|
||||
// after successful build is "running"
|
||||
_ = coderdtest.AwaitWorkspaceBuildJob(t, client, workspace.LatestBuild.ID)
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
|
||||
defer cancel()
|
||||
|
||||
workspace, err := client.Workspace(ctx, workspace.ID)
|
||||
require.NoError(t, err)
|
||||
require.EqualValues(t, codersdk.WorkspaceStatusRunning, workspace.LatestBuild.Status)
|
||||
|
Reference in New Issue
Block a user