8000 try to fix netty tests · DataDog/dd-trace-java@3357f5c · GitHub
[go: up one dir, main page]

Skip to content

Commit 3357f5c

Browse files
committed
try to fix netty tests
1 parent 5fd4cf2 commit 3357f5c

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

dd-java-agent/instrumentation/netty-3.8/src/test/groovy/datadog/trace/instrumentation/netty38/Netty38ServerTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ abstract class Netty38ServerTest extends HttpServerTest<ServerBootstrap> {
172172
def frame = msg.getMessage() as WebSocketFrame
173173

174174
if (frame instanceof CloseWebSocketFrame) {
175-
this.handshaker.close(ctx.getChannel(), (CloseWebSocketFrame) frame)
175+
WsEndpoint.onClose()
176176
} else if (frame instanceof PingWebSocketFrame) {
177177
ctx.getChannel().write(new PongWebSocketFrame(frame.getBinaryData()))
178178
} else if (frame instanceof TextWebSocketFrame || frame instanceof BinaryWebSocketFrame || frame instanceof ContinuationWebSocketFrame) {

dd-java-agent/instrumentation/netty-4.0/src/test/groovy/Netty40ServerTest.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ abstract class Netty40ServerTest extends HttpServerTest<EventLoopGroup> {
136136
if (msg instanceof TextWebSocketFrame || msg instanceof BinaryWebSocketFrame || msg instanceof ContinuationWebSocketFrame) {
137137
// generate a child span. The websocket test expects this way
138138
runUnderTrace("onRead", {})
139+
} else if (msg instanceof CloseWebSocketFrame) {
140+
WsEndpoint.onClose()
139141
}
140142
},
141143
exceptionCaught : { ChannelHandlerContext ctx, Throwable cause ->

dd-java-agent/instrumentation/netty-4.1/src/test/groovy/Netty41ServerTest.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ abstract class Netty41ServerTest extends HttpServerTest<EventLoopGroup> {
162162
if (msg instanceof TextWebSocketFrame || msg instanceof BinaryWebSocketFrame || msg instanceof ContinuationWebSocketFrame) {
163163
// generate a child span. The websocket test expects this way
164164
runUnderTrace("onRead", {})
165+
} else if (msg instanceof CloseWebSocketFrame) {
166+
WsEndpoint.onClose()
165167
}
166168
},
167169
exceptionCaught : { ChannelHandlerContext ctx, Throwable cause ->

0 commit comments

Comments
 (0)
0