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

   ### Which Issue(s) This PR Fixes
   
   - Fixes #6079
   
   ### Brief Description
   
   `AliyunInstanceProvider.listTopics` and `listConsumerGroups` ended their 
paging loops on a page
   shorter than the requested `PAGE_SIZE` (`AliyunInstanceProvider.java:173`, 
`:336`) while
   `hasFetchedAll` compared the rows *requested* with `TotalCount` instead of 
the rows the response
   carried (`:230`), so a short page that still left `offset + returned` below 
a known non-negative
   `TotalCount` produced a truncated topic or consumer group inventory that 
Studio rendered as
   complete. The Tencent scans were fixed for exactly this in #4531 
(`fix(tencent): reject incomplete
   resource pages`); this brings the two Aliyun scans to the same shape: 
`requireCompletePage` throws
   502 when a short page contradicts `TotalCount`, `hasFetchedAll` counts 
returned rows, and a
   missing/negative `TotalCount` keeps the previous short-page termination. 
User-visible change: a
   contradictory page now fails with 502 instead of being listed as the 
complete inventory; unknown
   totals and genuinely empty pages behave exactly as before.
   
   ### How Did You Test This Change?
   
   ```
   $ mvn -B -ntp test -DforkCount=1 -Dtest=AliyunInstanceProviderTest
   [INFO] --- checkstyle:3.6.0:check (validate) @ rocketmq-studio ---
   [INFO] You have 0 Checkstyle violations.
   [INFO] Tests run: 43, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 
1.305 s -- in 
org.apache.rocketmq.studio.provider.alibaba.AliyunInstanceProviderTest
   [INFO] BUILD SUCCESS
   ```
   
   The new tests fail without the fix (the product change was reverted, the 
tests were kept):
   
   ```
   $ mvn -B -ntp test -DforkCount=1 -Dtest=AliyunInstanceProviderTest
   [ERROR] Tests run: 43, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 
1.296 s <<< FAILURE! -- in 
org.apache.rocketmq.studio.provider.alibaba.AliyunInstanceProviderTest
   
...AliyunInstanceProviderTest.listConsumerGroupsShouldRejectIncompletePageWhenTotalCountRequiresMoreTest
 -- Time elapsed: 0.012 s <<< FAILURE!
   java.lang.AssertionError:
   Expecting code to raise a throwable.
   
...AliyunInstanceProviderTest.listTopicsShouldRejectIncompletePageWhenTotalCountRequiresMoreTest
 -- Time elapsed: 0.003 s <<< FAILURE!
   java.lang.AssertionError:
   Expecting code to raise a throwable.
   ```
   
   Both new tests stub one row against `TotalCount = 2`. The existing
   `listConsumerGroupsShouldStopOnShortPageWhenTotalCountIsMissingTest`,
   `listTopicsShouldTraversePastLegacyFivePageCapTest`,
   `listConsumerGroupsShouldFetchExactlyFiveFullPagesTest` and
   `listConsumerGroupsShouldTraversePastLegacyFivePageCapTest` keep passing, 
which pins that unknown
   totals and full-page scans still terminate the way they did.
   
   CLUSTER: not applicable — reproduced with a stubbed Aliyun Cloud SDK 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