Skip to content

Commit 12405ae

Browse files
committed
chore(cli): fix test flake in TestExpMcpServer
1 parent af2941b commit 12405ae

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

cli/exp_mcp_test.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,19 @@ func TestExpMcpServer(t *testing.T) {
148148
pty := ptytest.New(t)
149149
inv.Stdin = pty.Input()
150150
inv.Stdout = pty.Output()
151+
inv.Stderr = pty.Output()
151152
clitest.SetupConfig(t, client, root)
152153

153-
err := inv.Run()
154-
assert.ErrorContains(t, err, "are not logged in")
154+
cmdDone := make(chan struct{})
155+
go func() {
156+
defer close(cmdDone)
157+
err := inv.Run()
158+
assert.NoError(t, err)
159+
}()
160+
161+
pty.ExpectRegexMatch(`(?is)Authentication\s+:\s+None`)
162+
cancel()
163+
<-cmdDone
155164
})
156165
}
157166

0 commit comments

Comments
 (0)