Merge pull request #10993 from yuzeming/patch-1

integration: fix a data race about `err`
This commit is contained in:
Jingyi Hu 2019-08-06 15:58:21 -07:00 committed by GitHub
commit 0d85aa1b41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,12 +41,13 @@ func TestV3ClientMetrics(t *testing.T) {
var (
addr = "localhost:27989"
ln net.Listener
err error
)
// listen for all Prometheus metrics
donec := make(chan struct{})
go func() {
var err error
defer close(donec)
srv := &http.Server{Handler: promhttp.Handler()}
@ -87,7 +88,7 @@ func TestV3ClientMetrics(t *testing.T) {
pBefore := sumCountersForMetricAndLabels(t, url, "grpc_client_started_total", "Put", "unary")
_, err = cli.Put(context.Background(), "foo", "bar")
_, err := cli.Put(context.Background(), "foo", "bar")
if err != nil {
t.Errorf("Error putting value in key store")
}