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

   ### Which Issue(s) This PR Fixes
   
   <!-- Fixes #NNN to be backfilled right after the issue is filed -->
   
   ### Brief Description
   
   `AuthServiceSessionOverviewIntegrationTest` asserts second-exact values 
(e.g. `idleSeconds >= 60`) that are derived from a wall-clock 
`LocalDateTime.now()` with sub-second precision. The `rmq_studio_session` table 
stores `last_seen_at` / `expires_at` as `DATETIME` (second precision), and 
MySQL rounds stored values up, so when the test starts in the second half of a 
second, an inserted "now minus 1 minute" last-seen value reads back one second 
younger and `idleSeconds` truncates to 59 — the `>= 60` (and likewise the `>= 
20 * 60`) assertions fail intermittently. We hit this on a full-suite run 
against master@d50ffecc (2414 tests, this one failure).
   
   The test derives its timestamps from 
`LocalDateTime.now(ZoneOffset.UTC).truncatedTo(ChronoUnit.SECONDS)` now, so the 
stored values are exact and the assertions are deterministic. No production 
code is changed; the class still runs the aggregate against the real database, 
which is the point of it being an integration test.
   
   ### How Did You Test This Change?
   
   - Baseline failure on master@d50ffecc, 2026-09-19: `cd server && mvn -B -ntp 
test` → `Tests run: 2414, Failures: 1` — 
`listActiveSessionsForUserReturnsOnlyThatUsersActiveSessionDetailsTest`, 
expected `idleSeconds >= 60` but got `59`.
   - Verified the storage behaviour directly on MySQL 8.0.46: `SELECT 
CAST('2026-09-20 10:00:00.7' AS DATETIME)` returns `2026-09-20 10:00:01` 
(rounds up).
   - After the fix, 2026-09-20: `cd server && mvn -B -ntp test 
-Dtest=AuthServiceSessionOverviewIntegrationTest` → `Tests run: 3, Failures: 0, 
Errors: 0, Skipped: 0`. Checkstyle runs in the Maven validate phase and 
reported no violations.
   
   ### 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/` 
(no UI text changed)
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks) (test-only change)
   - [ ] New source files carry the ASF license header (no new source files)
   - [ ] Documentation touched where behaviour changed (README / `docs/` / 
in-app help) (no behaviour change)
   


-- 
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