Skip to content

Commit 86d66b1

Browse files
committed
fix tests
1 parent 4a9ab00 commit 86d66b1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

cli/exp_mcp_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ func TestExpMcpServer(t *testing.T) {
3333
ctx := testutil.Context(t, testutil.WaitShort)
3434
cmdDone := make(chan struct{})
3535
cancelCtx, cancel := context.WithCancel(ctx)
36-
t.Cleanup(func() {
37-
cancel()
38-
<-cmdDone
39-
})
4036

4137
// Given: a running coder deployment
4238
client := coderdtest.New(t, nil)
@@ -93,6 +89,8 @@ func TestExpMcpServer(t *testing.T) {
9389
require.NoError(t, err, "should have received a valid JSON response from the tool")
9490
// Ensure the tool returns the expected user
9591
require.Contains(t, output, owner.UserID.String(), "should have received the expected user ID")
92+
cancel()
93+
<-cmdDone
9694
})
9795

9896
t.Run("OK", func(t *testing.T) {

coderd/workspaceagents_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ func TestWorkspaceAgentLogs(t *testing.T) {
341341

342342
func TestWorkspaceAgentAppStatus(t *testing.T) {
343343
t.Parallel()
344-
ctx := testutil.Context(t, testutil.WaitMedium)
345344
client, db := coderdtest.NewWithDatabase(t, nil)
346345
user := coderdtest.CreateFirstUser(t, client)
347346
client, user2 := coderdtest.CreateAnotherUser(t, client, user.OrganizationID)
@@ -362,6 +361,7 @@ func TestWorkspaceAgentAppStatus(t *testing.T) {
362361
agentClient.SetSessionToken(r.AgentToken)
363362
t.Run("Success", func(t *testing.T) {
364363
t.Parallel()
364+
ctx := testutil.Context(t, testutil.WaitShort)
365365
err := agentClient.PatchAppStatus(ctx, agentsdk.PatchAppStatus{
366366
AppSlug: "vscode",
367367
Message: "testing",
@@ -385,6 +385,7 @@ func TestWorkspaceAgentAppStatus(t *testing.T) {
385385

386386
t.Run("FailUnknownApp", func(t *testing.T) {
387387
t.Parallel()
388+
ctx := testutil.Context(t, testutil.WaitShort)
388389
err := agentClient.PatchAppStatus(ctx, agentsdk.PatchAppStatus{
389390
AppSlug: "unknown",
390391
Message: "testing",
@@ -399,6 +400,7 @@ func TestWorkspaceAgentAppStatus(t *testing.T) {
399400

400401
t.Run("FailUnknownState", func(t *testing.T) {
401402
t.Parallel()
403+
ctx := testutil.Context(t, testutil.WaitShort)
402404
err := agentClient.PatchAppStatus(ctx, agentsdk.PatchAppStatus{
403405
AppSlug: "vscode",
404406
Message: "testing",
@@ -413,6 +415,7 @@ func TestWorkspaceAgentAppStatus(t *testing.T) {
413415

414416
t.Run("FailTooLong", func(t *testing.T) {
415417
t.Parallel()
418+
ctx := testutil.Context(t, testutil.WaitShort)
416419
err := agentClient.PatchAppStatus(ctx, agentsdk.PatchAppStatus{
417420
AppSlug: "vscode",
418421
Message: strings.Repeat("a", 161),

0 commit comments

Comments
 (0)