[CI] NettyClientTest.testServerDisconnection is flaky

Open Beginner friendly
#4,346 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
testing

Research direction

Start with NettyClientTest.testServerDisconnection and the existing CommonTestUtils.retry helper. Update the test to wait for the connection map to become empty before preserving its AssertJ assertion, without changing production connection behavior. Done means the test no longer races asynchronous connection cleanup.

Written by the indexing model from the issue text.

Description

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!
Dominant language
Java
Stars
2.2k
Forks
628
Avg merge
1d 19h
Merged PRs (30d)
138

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/fluss

All issues in apache/fluss

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.