Frun1na opened a new pull request, #6514:
URL: https://github.com/apache/rocketmq-dashboard/pull/6514
### Which Issue(s) This PR Fixes
- Fixes #5919
### Brief Description
`buildConsumerGroupCsv`
(`server/src/main/java/org/apache/rocketmq/studio/instance/topic/MetadataService.java:800`)
wrote `group.getDelaySeconds()` verbatim into the `Delay Seconds` column,
while the two columns next to it
already render "unknown" for their unmeasured sentinels (`lagText` on the
`-1` total lag, `onlineInstancesText`
on the negative online-instance count). A group whose broker-side stats
carry no consumed-message timestamp never
had the delay computed — `consumptionTimestampAvailable` stays false and
`delaySeconds` keeps its initial zero —
so the CSV export published a fabricated "0 seconds" that reads as a group
which is fully caught up.
`delayText(group)` now renders `unknown` unless the delay was measured, and
a measured delay still exports as its
seconds. This is the export surface of #5919: the console column, drawer and
sort order are #5920 and the
`rmq.group.detail` tool contract is #6106; the export was the one consumer
left. No endpoint
response changes.
User-visible change: the `Delay Seconds` cell of an unmeasured consumer
group reads `unknown` instead of `0`.
### How Did You Test This Change?
```
cd server && mvn -B -ntp test -DforkCount=1
-Dsurefire.failIfNoSpecifiedTests=false -Dtest=MetadataServiceTest
[INFO] Tests run: 60, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
1.536 s -- in MetadataServiceTest
[INFO] BUILD SUCCESS
```
`exportConsumerGroupsShouldRenderAnUnmeasurableDelayAsUnknownTest` asserts
both directions in one export: the row
of a group with `consumptionTimestampAvailable=false` and `delaySeconds=0`
reads `"unknown"` in that column,
while the row of a measured group reads `"7"`. The shared `consumerGroup`
fixture now sets
`consumptionTimestampAvailable=true` so the existing export fixtures keep
describing a group whose delay was
measured; no existing assertion asserted the delay column.
The new test fails without the fix — only the one `delayText(group)` call
reverted, the test kept:
```
[ERROR] Tests run: 60, Failures: 1, Errors: 0, Skipped: 0
exportConsumerGroupsShouldRenderAnUnmeasurableDelayAsUnknownTest -- <<<
FAILURE!
java.lang.AssertionError:
Expecting actual:
""Name","Namespace","Cluster ID",...,"Delay Seconds",...
"orders-measured","orders","cluster-a","Pop","CLUSTERING","1","10","7",...
"orders-unmeasured","orders","cluster-a","Pop","CLUSTERING","1","10","0",...
"
to contain:
""orders-unmeasured","orders","cluster-a","Pop","CLUSTERING","1","10","unknown""
```
The failure is the unmeasured row printing `0`; the measured row still
prints `7` in the same run, so the
assertion is sensitive to the flag rather than to "unknown" being written
unconditionally.
### 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]