Search before asking
Fluss version
main (development)
Please describe the bug 馃悶
NettyClientTest.testServerDisconnection can fail intermittently with:
The test waits for the failed request future and then immediately asserts that NettyClient.connections() is empty.
In ServerConnection.close(), pending request futures are completed before closeFuture. The connection-removal callback is attached to closeFuture, so the request future can complete before the disconnected connection is removed from the map.
This makes the assertion race with asynchronous connection cleanup. The production behavior is unaffected; the test should wait for the observable cleanup to finish.
Solution
Use the existing CommonTestUtils.retry helper to wait until the connection map becomes empty, while preserving the existing AssertJ assertion and leaving production connection behavior unchanged.
Are you willing to submit a PR?
Search before asking
Fluss version
main (development)
Please describe the bug 馃悶
NettyClientTest.testServerDisconnectioncan fail intermittently with:The test waits for the failed request future and then immediately asserts that
NettyClient.connections()is empty.In
ServerConnection.close(), pending request futures are completed beforecloseFuture. The connection-removal callback is attached tocloseFuture, so the request future can complete before the disconnected connection is removed from the map.This makes the assertion race with asynchronous connection cleanup. The production behavior is unaffected; the test should wait for the observable cleanup to finish.
Solution
Use the existing
CommonTestUtils.retryhelper to wait until the connection map becomes empty, while preserving the existing AssertJ assertion and leaving production connection behavior unchanged.Are you willing to submit a PR?