Skip to content

fix: correct trend history never being recorded - #2389

Merged
lbroudoux merged 1 commit into
microcks:masterfrom
prasu-baran:fix/2385-metrics-trend-history
Oct 22, 2026
Merged

lbroudoux merged 1 commit into
microcks:masterfrom
prasu-baran:fix/2385-metrics-trend-history

Conversation

@prasu-baran

@prasu-baran prasu-baran commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • The test conformance trend (UP/DOWN/STABLE) never updates for any service. MetricsService.updateTestConformanceMetricOnTestResult() only writes today's score into the history map inside an if block that requires the history to already have enough entries - but the history starts empty, so that condition is never true, so the write never happens, so the history can never get its first entry.
  • Fix: move the metric.getLatestScores().put(...) call to run unconditionally after the if block, instead of being trapped inside it. The trend calculation and history logic inside the if block are unchanged.
  • Added MetricsServiceTest with two tests calling the real method via Mockito: one confirms the history gains an entry on the first call (the core bug), one confirms the existing trend math still works correctly once history already exists.

Related issue(s)

Fixes #2379

@lbroudoux lbroudoux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good! Thanks a lot!

@lbroudoux lbroudoux added this to the 1.16.0 milestone Oct 22, 2026
@lbroudoux
lbroudoux merged commit fe97982 into microcks:master Oct 22, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test conformance trend never updates : Score history is never saved

2 participants