-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Copy link
Labels
Description
Version
master
Context
The test sometimes fails, with a percentage of 20% (?) when running it locally in my IDE.
It also failed in the CI
See https://github.com/eclipse-vertx/vert.x/actions/runs/20429375873/job/58696486105
Steps to reproduce
Run the test.
When debugging this, I found that the following snippet connects to NetServer, but then disconnects immediately without sending any data. I assume that the NetClient is garbage collected.
I'll prepare a PR where this no longer happens by keeping a reference.
vert.x/vertx-core/src/test/java/io/vertx/tests/http/HttpTest.java
Lines 4782 to 4801 in 785b9cf
| vertx.createNetServer(new NetServerOptions().setPort(1235).setHost("localhost")).connectHandler(socket -> { | |
| socket.handler(socket::write); | |
| closeSocket.thenAccept(v -> { | |
| socket.close(); | |
| }); | |
| }).listen().onComplete(onSuccess(netServer -> { | |
| server.requestHandler(req -> { | |
| vertx.createNetClient(new NetClientOptions()).connect(1235, "localhost").onComplete(onSuccess(dst -> { | |
| req.response().setStatusCode(sc); | |
| req.response().setStatusMessage("Connection established"); | |
| // Now create a NetSocket | |
| req.toNetSocket().onComplete(onSuccess(src -> { | |
| // Create pumps which echo stuff | |
| src.pipeTo(dst); | |
| dst.pipeTo(src); | |
| })); | |
| })); | |
| }); |
Do you have a reproducer?
No response