Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: macos flake
  • Loading branch information
coadler committed May 26, 2022
commit cd88da0c5085ea31cdbbf2ddeefedd13c3c6e497
6 changes: 4 additions & 2 deletions cli/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,19 @@ func TestServer(t *testing.T) {
require.Eventually(t, func() bool {
var err error
token, err = cfg.Session().Read()
return err == nil
return err == nil && token != ""
}, 15*time.Second, 25*time.Millisecond)

// Verify that authentication was properly set in dev-mode.
accessURL, err := cfg.URL().Read()
require.NoError(t, err)
parsed, err := url.Parse(accessURL)
require.NoError(t, err)

client := codersdk.New(parsed)
client.SessionToken = token
_, err = client.User(ctx, codersdk.Me)
require.NoError(t, err)
require.NoError(t, err, "token:", token)

cancelFunc()
require.ErrorIs(t, <-errC, context.Canceled)
Expand Down