fix(trace): grpc exporter should use nonblock option (#2744)

* fix(trace): grpc exporter should use nonblock option

* chore: sort imports
This commit is contained in:
cong
2023-01-03 18:15:09 +08:00
committed by GitHub
parent 036328f1ea
commit deefc1a8eb
2 changed files with 13 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/zeromicro/go-zero/core/logx"
)
@@ -13,6 +14,7 @@ func TestStartAgent(t *testing.T) {
const (
endpoint1 = "localhost:1234"
endpoint2 = "remotehost:1234"
endpoint3 = "localhost:1235"
)
c1 := Config{
Name: "foo",
@@ -29,12 +31,12 @@ func TestStartAgent(t *testing.T) {
}
c4 := Config{
Name: "bla",
Endpoint: endpoint1,
Endpoint: endpoint3,
Batcher: "otlp",
}
c5 := Config{
Name: "grpc",
Endpoint: endpoint1,
Endpoint: endpoint3,
Batcher: "grpc",
}
@@ -49,7 +51,7 @@ func TestStartAgent(t *testing.T) {
defer lock.Unlock()
// because remotehost cannot be resolved
assert.Equal(t, 2, len(agents))
assert.Equal(t, 3, len(agents))
_, ok := agents[""]
assert.True(t, ok)
_, ok = agents[endpoint1]