Fix some tests on windows (#4288)

This commit is contained in:
Trask Stalnaker 2021-10-04 21:40:24 -07:00 committed by GitHub
parent 90c0df9328
commit d2b7786027
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 25 deletions

View File

@ -137,8 +137,8 @@ abstract class AbstractGrpcStreamingTest extends InstrumentationSpecification {
"${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter"
"${SemanticAttributes.RPC_METHOD.key}" "Conversation"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
// "localhost" on linux, "127.0.0.1" on windows
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == "127.0.0.1" }
// net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == null }
"${SemanticAttributes.NET_PEER_PORT.key}" Long
"${SemanticAttributes.NET_TRANSPORT.key}" SemanticAttributes.NetTransportValues.IP_TCP
"${SemanticAttributes.RPC_GRPC_STATUS_CODE.key}" Status.OK.code.value()

View File

@ -141,8 +141,8 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
"${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter"
"${SemanticAttributes.RPC_METHOD.key}" "SayHello"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
// "localhost" on linux, "127.0.0.1" on windows
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == "127.0.0.1" }
// net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == null }
"${SemanticAttributes.NET_PEER_PORT.key}" Long
"${SemanticAttributes.NET_TRANSPORT.key}" SemanticAttributes.NetTransportValues.IP_TCP
"${SemanticAttributes.RPC_GRPC_STATUS_CODE.key}" Status.Code.OK.value()
@ -261,8 +261,8 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
"${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter"
"${SemanticAttributes.RPC_METHOD.key}" "SayHello"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
// "localhost" on linux, "127.0.0.1" on windows
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == "127.0.0.1" }
// net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == null }
"${SemanticAttributes.NET_PEER_PORT.key}" Long
"${SemanticAttributes.NET_TRANSPORT.key}" SemanticAttributes.NetTransportValues.IP_TCP
"${SemanticAttributes.RPC_GRPC_STATUS_CODE.key}" Status.Code.OK.value()
@ -394,8 +394,8 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
"${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter"
"${SemanticAttributes.RPC_METHOD.key}" "SayHello"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
// "localhost" on linux, "127.0.0.1" on windows
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == "127.0.0.1" }
// net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == null }
"${SemanticAttributes.NET_PEER_PORT.key}" Long
"${SemanticAttributes.NET_TRANSPORT.key}" SemanticAttributes.NetTransportValues.IP_TCP
"${SemanticAttributes.RPC_GRPC_STATUS_CODE.key}" Status.Code.OK.value()
@ -487,8 +487,8 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
"${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter"
"${SemanticAttributes.RPC_METHOD.key}" "SayHello"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
// "localhost" on linux, "127.0.0.1" on windows
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == "127.0.0.1" }
// net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == null }
"${SemanticAttributes.NET_PEER_PORT.key}" Long
"${SemanticAttributes.NET_TRANSPORT}" SemanticAttributes.NetTransportValues.IP_TCP
"${SemanticAttributes.RPC_GRPC_STATUS_CODE}" grpcStatus.code.value()
@ -585,8 +585,8 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
"${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter"
"${SemanticAttributes.RPC_METHOD.key}" "SayHello"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
// "localhost" on linux, "127.0.0.1" on windows
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == "127.0.0.1" }
// net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == null }
"${SemanticAttributes.NET_PEER_PORT.key}" Long
"${SemanticAttributes.NET_TRANSPORT.key}" SemanticAttributes.NetTransportValues.IP_TCP
}
@ -765,8 +765,8 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
"${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter"
"${SemanticAttributes.RPC_METHOD.key}" "SayHello"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
// "localhost" on linux, "127.0.0.1" on windows
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == "127.0.0.1" }
// net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == null }
"${SemanticAttributes.NET_PEER_PORT.key}" Long
"${SemanticAttributes.NET_TRANSPORT.key}" SemanticAttributes.NetTransportValues.IP_TCP
"${SemanticAttributes.RPC_GRPC_STATUS_CODE.key}" Status.OK.code.value()
@ -896,8 +896,8 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
"${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter"
"${SemanticAttributes.RPC_METHOD.key}" "SayHello"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
// "localhost" on linux, "127.0.0.1" on windows
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == "127.0.0.1" }
// net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == null }
"${SemanticAttributes.NET_PEER_PORT.key}" Long
"${SemanticAttributes.NET_TRANSPORT.key}" SemanticAttributes.NetTransportValues.IP_TCP
}
@ -1010,8 +1010,8 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
"${SemanticAttributes.RPC_SERVICE.key}" "grpc.reflection.v1alpha.ServerReflection"
"${SemanticAttributes.RPC_METHOD.key}" "ServerReflectionInfo"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
// "localhost" on linux, "127.0.0.1" on windows
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == "127.0.0.1" }
// net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == null }
"${SemanticAttributes.NET_PEER_PORT.key}" Long
"${SemanticAttributes.NET_TRANSPORT.key}" SemanticAttributes.NetTransportValues.IP_TCP
"${SemanticAttributes.RPC_GRPC_STATUS_CODE.key}" Status.OK.code.value()
@ -1118,7 +1118,8 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
"${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter"
"${SemanticAttributes.RPC_METHOD.key}" "SayHello"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == "127.0.0.1" }
// net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == null }
"${SemanticAttributes.NET_PEER_PORT.key}" Long
"${SemanticAttributes.NET_TRANSPORT.key}" SemanticAttributes.NetTransportValues.IP_TCP
"${SemanticAttributes.RPC_GRPC_STATUS_CODE.key}" Status.Code.OK.value()

View File

@ -145,8 +145,8 @@ class UndertowServerTest extends HttpServerTest<Undertow> implements AgentTestTr
"${SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH}" Long
"${SemanticAttributes.HTTP_SCHEME}" "http"
"${SemanticAttributes.HTTP_TARGET}" "/sendResponse"
// "localhost" on linux, "127.0.0.1" on windows
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == "127.0.0.1" }
// net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == null }
"${SemanticAttributes.NET_TRANSPORT}" SemanticAttributes.NetTransportValues.IP_TCP
}
}
@ -200,8 +200,8 @@ class UndertowServerTest extends HttpServerTest<Undertow> implements AgentTestTr
"${SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH}" Long
"${SemanticAttributes.HTTP_SCHEME}" "http"
"${SemanticAttributes.HTTP_TARGET}" "/sendResponseWithException"
// "localhost" on linux, "127.0.0.1" on windows
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == "127.0.0.1" }
// net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == null }
"${SemanticAttributes.NET_TRANSPORT}" SemanticAttributes.NetTransportValues.IP_TCP
}
}

View File

@ -598,8 +598,8 @@ abstract class HttpServerTest<SERVER> extends InstrumentationSpecification imple
"${SemanticAttributes.HTTP_SERVER_NAME}" String
}
if (extraAttributes.contains(SemanticAttributes.NET_PEER_NAME)) {
// "localhost" on linux, "127.0.0.1" on windows
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == "127.0.0.1" }
// net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured
"${SemanticAttributes.NET_PEER_NAME.key}" { it == "localhost" || it == null }
}
if (extraAttributes.contains(SemanticAttributes.NET_TRANSPORT)) {
"${SemanticAttributes.NET_TRANSPORT}" IP_TCP