-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to fix flaky TestGetRoundTripper* tests #4738
Attempt to fix flaky TestGetRoundTripper* tests #4738
Conversation
Signed-off-by: Albert Teoh <albert@packsmith.io>
Signed-off-by: Albert Teoh <albert@packsmith.io>
Signed-off-by: Albert Teoh <albert@packsmith.io>
Signed-off-by: Albert Teoh <albert@packsmith.io>
Codecov ReportPatch has no changes to coverable lines. 📢 Thoughts on this report? Let us know!. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using boolean in the assert is not the best output when the assert fails. Using the actual string produces much more intuitive output in case of test failure.
@@ -537,10 +538,14 @@ func TestGetRoundTripperTLSConfig(t *testing.T) { | |||
}, logger) | |||
require.NoError(t, err) | |||
|
|||
var authReceived atomic.Bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var authReceived atomic.Bool | |
var authReceived atomic.Pointer[string] |
if r.Header.Get("Authorization") == "Bearer foo" { | ||
authReceived.Store(true) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if r.Header.Get("Authorization") == "Bearer foo" { | |
authReceived.Store(true) | |
} | |
h := r.Header.Get("Authorization") | |
authReceived.Store(&h) |
assert.Equal(t, http.StatusOK, resp.StatusCode) | ||
assert.True(t, authReceived.Load()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert.True(t, authReceived.Load()) | |
assert.Equal(t, "Bearer foo", *authReceived.Load()) |
if err != nil { | ||
return err | ||
} | ||
require.NoError(t, err) | ||
|
||
_, err = fmt.Fprintln(w, string(bytes)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_, err = fmt.Fprintln(w, string(bytes)) | |
_, err = w.Write(bytes) |
Signed-off-by: Albert Teoh <albert@packsmith.io>
Good suggestion, addressed in: 31bdc02 |
Which problem is this PR solving?
Description of the changes
true
if the expected request is received.How was this change tested?
make test
to pass.go test -tags=memory_storage_integration -count 10 ./...
and confirmedmetricsstore
tests are passing.-count 10
flag set, not as a result of the changes from this PR, namely:and
Checklist
jaeger
:make lint test
jaeger-ui
:yarn lint
andyarn test