add kindJaegerUdp

This commit is contained in:
xiandong
2023-02-17 12:58:31 +08:00
committed by Kevin Wan
parent 12060c9c0c
commit b6bedcd522
3 changed files with 38 additions and 49 deletions

View File

@@ -11,12 +11,11 @@ func TestStartAgent(t *testing.T) {
logx.Disable()
const (
endpoint1 = "localhost:1234"
endpoint2 = "remotehost:1234"
endpoint3 = "localhost:1235"
endpoint4 = "localhost:1236"
agentHost1 = "localhost"
agentPort1 = "6831"
endpoint1 = "localhost:1234"
endpoint2 = "remotehost:1234"
endpoint3 = "localhost:1235"
endpoint4 = "localhost:1236"
endpoint5 = "localhost:6831"
)
c1 := Config{
Name: "foo",
@@ -47,17 +46,9 @@ func TestStartAgent(t *testing.T) {
Batcher: kindOtlpHttp,
}
c7 := Config{
Name: "jaegerUDP",
AgentHost: agentHost1,
AgentPort: agentPort1,
Batcher: kindJaeger,
}
c8 := Config{
Name: "jaegerUDP",
AgentHost: agentHost1,
AgentPort: agentPort1,
Endpoint: endpoint1,
Batcher: kindJaeger,
Name: "UDP",
Endpoint: endpoint5,
Batcher: kindJaegerUdp,
}
StartAgent(c1)
@@ -68,7 +59,6 @@ func TestStartAgent(t *testing.T) {
StartAgent(c5)
StartAgent(c6)
StartAgent(c7)
StartAgent(c8)
lock.Lock()
defer lock.Unlock()
@@ -81,12 +71,6 @@ func TestStartAgent(t *testing.T) {
assert.True(t, ok)
_, ok = agents[endpoint2]
assert.False(t, ok)
_, ok = agents[c2.getEndpoint()]
assert.True(t, ok)
_, ok = agents[c3.getEndpoint()]
assert.False(t, ok)
_, ok = agents[c7.getEndpoint()]
assert.True(t, ok)
_, ok = agents[c8.getEndpoint()]
_, ok = agents[endpoint5]
assert.True(t, ok)
}