Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite94fdaf

Browse files
committed
Avoid data race on buffer by reading after exit
1 parent3cd7460 commite94fdaf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎cli/server_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ func TestServer(t *testing.T) {
8080
gofunc() {
8181
err:=root.ExecuteContext(ctx)
8282
require.ErrorIs(t,err,context.Canceled)
83+
84+
// Verify that credentials were output to the terminal.
85+
wantEmail:="email: admin@coder.com"
86+
wantPassword:="password: password"
87+
assert.Contains(t,stdoutBuf.String(),wantEmail,"expected output %q; got no match",wantEmail)
88+
assert.Contains(t,stdoutBuf.String(),wantPassword,"expected output %q; got no match",wantPassword)
8389
}()
8490
vartokenstring
8591
require.Eventually(t,func()bool {
@@ -92,11 +98,6 @@ func TestServer(t *testing.T) {
9298
require.NoError(t,err)
9399
parsed,err:=url.Parse(accessURL)
94100
require.NoError(t,err)
95-
// Verify that credentials were output to the terminal.
96-
wantEmail:="email: admin@coder.com"
97-
wantPassword:="password: password"
98-
assert.Contains(t,stdoutBuf.String(),wantEmail,"expected output %q; got no match",wantEmail)
99-
assert.Contains(t,stdoutBuf.String(),wantPassword,"expected output %q; got no match",wantPassword)
100101
client:=codersdk.New(parsed)
101102
client.SessionToken=token
102103
_,err=client.User(ctx,codersdk.Me)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp