Frun1na opened a new pull request, #6076:
URL: https://github.com/apache/rocketmq-dashboard/pull/6076

   ### Which Issue(s) This PR Fixes
   
   - Fixes #6075
   
   ### Brief Description
   
   `TencentInstanceProvider.getTopicConsumers` ended its `DescribeTopic` paging 
loop on any page
   shorter than `CONSUMER_PAGE_SIZE` (`TencentInstanceProvider.java:428`) 
without consulting the
   `SubscriptionCount` the same response carries, so a short page from a 
provider that still reported
   more subscriptions was returned as a complete consumer list — and the topic 
detail page showed
   fewer consumer groups than actually subscribe to the topic. #4531 
(`fix(tencent): reject
   incomplete resource pages`) added `requireCompletePage` to the other three 
paged scans in this
   class; this is the fourth one, so the scan now calls the same guard and the 
offset is shared
   between the request and the guard. A user-visible change: a contradictory 
page now fails with
   502 instead of being rendered as a complete list; null/negative counts and a 
genuinely empty page
   end the scan exactly as before.
   
   ### How Did You Test This Change?
   
   ```
   $ mvn -B -ntp test -DforkCount=1 -Dtest=TencentInstanceProviderTest
   [INFO] --- checkstyle:3.6.0:check (validate) @ rocketmq-studio ---
   [INFO] You have 0 Checkstyle violations.
   [INFO] Tests run: 56, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 
1.585 s -- in 
org.apache.rocketmq.studio.provider.tencent.TencentInstanceProviderTest
   [INFO] BUILD SUCCESS
   ```
   
   The new test fails without the fix (the guard is the only product change; 
the test was kept
   unchanged for this run):
   
   ```
   $ mvn -B -ntp test -DforkCount=1 -Dtest=TencentInstanceProviderTest
   [ERROR] Tests run: 56, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 
1.427 s <<< FAILURE! -- in 
org.apache.rocketmq.studio.provider.tencent.TencentInstanceProviderTest
   
org.apache.rocketmq.studio.provider.tencent.TencentInstanceProviderTest.getTopicConsumersShouldRejectIncompletePageWhenSubscriptionCountRequiresMoreTest
 -- Time elapsed: 0.013 s <<< FAILURE!
   java.lang.AssertionError:
   Expecting code to raise a throwable.
   ```
   
   The test stubs a `DescribeTopicResponse` that carries one subscription and
   `SubscriptionCount = 2`. `getTopicConsumersShouldMapSubscriptionsTest` 
(count omitted),
   `getTopicConsumersShouldReadEverySubscriptionPageTest` (100 + 1 rows, count 
101) and
   `getTopicConsumersShouldStopAfterSubscriptionCountReachedOnFullPageTest` 
(100 + 100 rows,
   count 200) keep passing, which pins that a legitimate last page still 
terminates the scan.
   
   CLUSTER: not applicable — reproduced with a stubbed Tencent client in a unit 
test.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [ ] New source files carry the ASF license header
   - [ ] Documentation touched where behaviour changed (README / `docs/` / 
in-app help)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to