Skip to content

Commit 607cd11

Browse files
authored
fix(cli): address race condition in scaletest_test output (#8902)
1 parent 5106dfd commit 607cd11

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cli/exp_scaletest_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cli_test
22

33
import (
4-
"bytes"
54
"context"
65
"path/filepath"
76
"testing"
@@ -72,9 +71,10 @@ func TestScaleTestWorkspaceTraffic(t *testing.T) {
7271
"--ssh",
7372
)
7473
clitest.SetupConfig(t, client, root)
75-
var stdout, stderr bytes.Buffer
76-
inv.Stdout = &stdout
77-
inv.Stderr = &stderr
74+
pty := ptytest.New(t)
75+
inv.Stdout = pty.Output()
76+
inv.Stderr = pty.Output()
77+
7878
err := inv.WithContext(ctx).Run()
7979
require.ErrorContains(t, err, "no scaletest workspaces exist")
8080
}
@@ -98,9 +98,10 @@ func TestScaleTestDashboard(t *testing.T) {
9898
"--scaletest-prometheus-wait", "0s",
9999
)
100100
clitest.SetupConfig(t, client, root)
101-
var stdout, stderr bytes.Buffer
102-
inv.Stdout = &stdout
103-
inv.Stderr = &stderr
101+
pty := ptytest.New(t)
102+
inv.Stdout = pty.Output()
103+
inv.Stderr = pty.Output()
104+
104105
err := inv.WithContext(ctx).Run()
105106
require.NoError(t, err, "")
106107
}

0 commit comments

Comments
 (0)