Skip to content

Commit 45eadfc

Browse files
authored
fix(cli): specify IgnoreErrors in slogtest options for scaletest cli tests (#9751)
* fix(cli): specify IgnoreErrors in slogtest options for scaletest cli tests * bump test timeout
1 parent 17f9991 commit 45eadfc

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

cli/exp_scaletest_test.go

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77

88
"github.com/stretchr/testify/require"
99

10+
"cdr.dev/slog/sloggers/slogtest"
11+
1012
"github.com/coder/coder/v2/cli/clitest"
1113
"github.com/coder/coder/v2/coderd/coderdtest"
1214
"github.com/coder/coder/v2/pty/ptytest"
@@ -21,7 +23,12 @@ func TestScaleTestCreateWorkspaces(t *testing.T) {
2123
ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitLong)
2224
defer cancelFunc()
2325

24-
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
26+
log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
27+
client := coderdtest.New(t, &coderdtest.Options{
28+
// We are not including any provisioner daemons because we do not actually
29+
// build any workspaces here.
30+
Logger: &log,
31+
})
2532
_ = coderdtest.CreateFirstUser(t, client)
2633

2734
// Write a parameters file.
@@ -59,7 +66,10 @@ func TestScaleTestWorkspaceTraffic(t *testing.T) {
5966
ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitMedium)
6067
defer cancelFunc()
6168

62-
client := coderdtest.New(t, nil)
69+
log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
70+
client := coderdtest.New(t, &coderdtest.Options{
71+
Logger: &log,
72+
})
6373
_ = coderdtest.CreateFirstUser(t, client)
6474

6575
inv, root := clitest.New(t, "exp", "scaletest", "workspace-traffic",
@@ -82,21 +92,20 @@ func TestScaleTestWorkspaceTraffic(t *testing.T) {
8292
// This test just validates that the CLI command accepts its known arguments.
8393
func TestScaleTestDashboard(t *testing.T) {
8494
t.Parallel()
85-
if testutil.RaceEnabled() {
86-
t.Skip("Flakes under race detector, see https://github.com/coder/coder/issues/9168")
87-
}
88-
8995
ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitMedium)
9096
defer cancelFunc()
9197

92-
client := coderdtest.New(t, nil)
98+
log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
99+
client := coderdtest.New(t, &coderdtest.Options{
100+
Logger: &log,
101+
})
93102
_ = coderdtest.CreateFirstUser(t, client)
94103

95104
inv, root := clitest.New(t, "exp", "scaletest", "dashboard",
96105
"--count", "1",
97106
"--min-wait", "100ms",
98107
"--max-wait", "1s",
99-
"--timeout", "1s",
108+
"--timeout", "5s",
100109
"--scaletest-prometheus-address", "127.0.0.1:0",
101110
"--scaletest-prometheus-wait", "0s",
102111
)

0 commit comments

Comments
 (0)