MCPcopy Index your code
hub / github.com/coder/coder / pauseTask

Function pauseTask

cli/task_test.go:343–350  ·  view source on GitHub ↗

pauseTask pauses the task and waits for the stop build to complete.

(ctx context.Context, t *testing.T, client *codersdk.Client, task codersdk.Task)

Source from the content-addressed store, hash-verified

341
342// pauseTask pauses the task and waits for the stop build to complete.
343func pauseTask(ctx context.Context, t *testing.T, client *codersdk.Client, task codersdk.Task) {
344 t.Helper()
345
346 pauseResp, err := client.PauseTask(ctx, task.OwnerName, task.ID)
347 require.NoError(t, err)
348 require.NotNil(t, pauseResp.WorkspaceBuild)
349 coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, pauseResp.WorkspaceBuild.ID)
350}
351
352// resumeTask resumes the task waits for the start build to complete. The task
353// will be in "initializing" state after this returns because no agent is connected.

Callers 3

TestExpTaskResumeFunction · 0.70
Test_TaskSendFunction · 0.70
TestExpTaskPauseFunction · 0.70

Calls 3

PauseTaskMethod · 0.80
HelperMethod · 0.65

Tested by

no test coverage detected