Skip to content

[CI] NettyClientTest.testServerDisconnection is flaky#4346

Description

@litiliu

Search before asking

  • I searched in the issues and found nothing similar.

Fluss version

main (development)

Please describe the bug 馃悶

NettyClientTest.testServerDisconnection can fail intermittently with:

expected: 0
 but was: 1

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?

  • I'm willing to submit a PR!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions