mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(cli): stat: set --host arg in TestStatCPUCmd to avoid test flakes in containers (#8806)
This commit is contained in:
+2
-2
@@ -74,7 +74,7 @@ func TestStatCPUCmd(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
|
||||
t.Cleanup(cancel)
|
||||
inv, _ := clitest.New(t, "stat", "cpu", "--output=text")
|
||||
inv, _ := clitest.New(t, "stat", "cpu", "--output=text", "--host")
|
||||
buf := new(bytes.Buffer)
|
||||
inv.Stdout = buf
|
||||
err := inv.WithContext(ctx).Run()
|
||||
@@ -87,7 +87,7 @@ func TestStatCPUCmd(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
|
||||
t.Cleanup(cancel)
|
||||
inv, _ := clitest.New(t, "stat", "cpu", "--output=json")
|
||||
inv, _ := clitest.New(t, "stat", "cpu", "--output=json", "--host")
|
||||
buf := new(bytes.Buffer)
|
||||
inv.Stdout = buf
|
||||
err := inv.WithContext(ctx).Run()
|
||||
|
||||
Reference in New Issue
Block a user