fix #7963 ClusterControllerTest.watch_withHttp2: use 30000ms timeout #7979
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ⅰ. Describe what this PR did
Fix
ClusterControllerTest.watch_withHttp2()flaky failure. The test was callingdoPostWithHttp2(..., callback, 30), which passes 30 milliseconds as the client timeout (timeoutMillisinHttpClientUtil). 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, andlatch.await(35, TimeUnit.SECONDS)returned false. This PR changes the timeout to 30000 ms (30 seconds) to align with the blockingwatch()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