Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Sumit6307
Copy link
Contributor

@Sumit6307 Sumit6307 commented Jan 29, 2026

Ⅰ. Describe what this PR did

Fix ClusterControllerTest.watch_withHttp2() flaky failure. The test was calling doPostWithHttp2(..., callback, 30), which passes 30 milliseconds as the client timeout (timeoutMillis in HttpClientUtil). The watch endpoint holds the connection until a cluster change event (published after ~2 seconds), so the client was timing out before the server responded, the callback never ran, and latch.await(35, TimeUnit.SECONDS) returned false. This PR changes the timeout to 30000 ms (30 seconds) to align with the blocking watch() test, so the HTTP/2 client waits long enough for the response and the callback runs, allowing the latch to count down and the assertion to pass.

Ⅱ. Does this pull request fix one issue?

fixes #7963

Ⅲ. Why don't you add test cases (unit test/integration test)?

This PR fixes an existing test (watch_withHttp2). No new test was added; the change makes the current test stable by correcting the client timeout so the test can complete successfully.

Ⅳ. Describe how to verify it

Run the cluster controller tests:

mvn test -pl server -Dtest=ClusterControllerTest#watch_withHttp2

Sumit6307 and others added 2 commits January 30, 2026 01:27
…meout

- doPostWithHttp2(..., callback, 30) used 30ms timeout; watch holds until event (~2s)
- Change to 30000ms to match blocking watch() test so callback runs and latch counts down
- Fixes 'expected: <true> but was: <false>' at latch.await(35, TimeUnit.SECONDS)
@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.78%. Comparing base (9e6a843) to head (4bed826).

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x    #7979      +/-   ##
============================================
+ Coverage     71.74%   71.78%   +0.04%     
  Complexity      872      872              
============================================
  Files          1300     1300              
  Lines         49727    49727              
  Branches       5908     5908              
============================================
+ Hits          35678    35699      +21     
+ Misses        11114    11092      -22     
- Partials       2935     2936       +1     

see 8 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lokidundun
Copy link
Contributor

Why is a new PR being opened for this issue when there was already a previous PR submitted for it

@xingfudeshi
Copy link
Member

duplicate with #7969

@Sumit6307
Copy link
Contributor Author

#7963

Thanks for the clarification. My understanding was that issue #7963 is still open, so I worked on fixing it and opened this PR. I may have missed PR #7969 while submitting. Apologies for the duplication — happy to coordinate or help on the existing PR if needed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClusterControllerTest.watch_withHttp2:192 expected: <true> but was: <false>

3 participants