Skip to content

Commit de6b5ed

Browse files
committed
chore: clitest: fix TestCli
1 parent 5c741f4 commit de6b5ed

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

cli/clitest/clitest_test.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
package clitest_test
22

33
import (
4-
"context"
54
"testing"
6-
"time"
75

8-
"github.com/stretchr/testify/require"
96
"go.uber.org/goleak"
107

118
"github.com/coder/coder/cli/clitest"
@@ -19,20 +16,15 @@ func TestMain(m *testing.M) {
1916

2017
func TestCli(t *testing.T) {
2118
t.Parallel()
22-
ctx, cancelFunc := context.WithTimeout(context.Background(), 5*time.Second)
23-
defer cancelFunc()
2419
clitest.CreateTemplateVersionSource(t, nil)
2520
client := coderdtest.New(t, nil)
2621
cmd, config := clitest.New(t)
2722
clitest.SetupConfig(t, client, config)
2823
pty := ptytest.New(t)
2924
cmd.SetIn(pty.Input())
3025
cmd.SetOut(pty.Output())
31-
errC := make(chan error)
3226
go func() {
33-
errC <- cmd.ExecuteContext(ctx)
27+
_ = cmd.Execute()
3428
}()
3529
pty.ExpectMatch("coder")
36-
cancelFunc()
37-
require.NoError(t, <-errC)
3830
}

0 commit comments

Comments
 (0)