From 4cb65bf1b7d200e35e3d2f9d81f60795bf73d9b0 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Mon, 17 Jul 2023 16:20:41 +0100 Subject: [PATCH 1/3] fix(cli): unskip test and explicitly set --host in test cmd invocation --- cli/stat_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cli/stat_test.go b/cli/stat_test.go index f955ccdb60e79..d92574e339b89 100644 --- a/cli/stat_test.go +++ b/cli/stat_test.go @@ -85,8 +85,6 @@ func TestStatCPUCmd(t *testing.T) { t.Run("JSON", func(t *testing.T) { t.Parallel() - t.Skip("https://github.com/coder/coder/issues/8091") - ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort) t.Cleanup(cancel) inv, _ := clitest.New(t, "stat", "cpu", "--output=json") @@ -111,7 +109,7 @@ func TestStatMemCmd(t *testing.T) { t.Parallel() ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort) t.Cleanup(cancel) - inv, _ := clitest.New(t, "stat", "mem", "--output=text") + inv, _ := clitest.New(t, "stat", "mem", "--output=text", "--host") buf := new(bytes.Buffer) inv.Stdout = buf err := inv.WithContext(ctx).Run() @@ -124,7 +122,7 @@ func TestStatMemCmd(t *testing.T) { t.Parallel() ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort) t.Cleanup(cancel) - inv, _ := clitest.New(t, "stat", "mem", "--output=json") + inv, _ := clitest.New(t, "stat", "mem", "--output=json", "--host") buf := new(bytes.Buffer) inv.Stdout = buf err := inv.WithContext(ctx).Run() From badd81494cab6e058fe6b5534abcbb2c5f5438b9 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Mon, 17 Jul 2023 16:38:49 +0100 Subject: [PATCH 2/3] skip TestWorkspaceWatcher if race enabled --- coderd/workspaces_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coderd/workspaces_test.go b/coderd/workspaces_test.go index edd62932a1886..d70a37c94212e 100644 --- a/coderd/workspaces_test.go +++ b/coderd/workspaces_test.go @@ -2036,6 +2036,9 @@ func TestWorkspaceExtend(t *testing.T) { func TestWorkspaceWatcher(t *testing.T) { t.Parallel() + if testutil.RaceEnabled() { + t.Skip("Race detector enabled, skipping time-sensitive test") + } client, closeFunc := coderdtest.NewWithProvisionerCloser(t, &coderdtest.Options{IncludeProvisionerDaemon: true}) defer closeFunc.Close() user := coderdtest.CreateFirstUser(t, client) From 5d1f1e9078a2c2efe8fce303f419c0444a68a0ca Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Mon, 17 Jul 2023 17:12:33 +0100 Subject: [PATCH 3/3] Revert "skip TestWorkspaceWatcher if race enabled" This reverts commit badd81494cab6e058fe6b5534abcbb2c5f5438b9. --- coderd/workspaces_test.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/coderd/workspaces_test.go b/coderd/workspaces_test.go index d70a37c94212e..edd62932a1886 100644 --- a/coderd/workspaces_test.go +++ b/coderd/workspaces_test.go @@ -2036,9 +2036,6 @@ func TestWorkspaceExtend(t *testing.T) { func TestWorkspaceWatcher(t *testing.T) { t.Parallel() - if testutil.RaceEnabled() { - t.Skip("Race detector enabled, skipping time-sensitive test") - } client, closeFunc := coderdtest.NewWithProvisionerCloser(t, &coderdtest.Options{IncludeProvisionerDaemon: true}) defer closeFunc.Close() user := coderdtest.CreateFirstUser(t, client)