Skip to content

Commit 5e66c61

Browse files
committed
test: provide Micrometer histogram bounds in no-SLA test
Micrometer requires valid expected histogram bounds even when SLA buckets are disabled. Stub the lowest, highest, and precision options in the no-SLA session metric test so it exercises the intended branch instead of failing while constructing the distribution configuration.
1 parent a9eaba2 commit 5e66c61

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

metrics/micrometer/src/test/java/com/datastax/oss/driver/internal/metrics/micrometer/MicrometerSessionMetricUpdaterTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ public void should_not_create_sla_percentiles(
132132
when(context.getMetricIdGenerator()).thenReturn(generator);
133133
when(profile.getDuration(DefaultDriverOption.METRICS_NODE_EXPIRE_AFTER))
134134
.thenReturn(Duration.ofHours(1));
135+
when(profile.getDuration(lowest)).thenReturn(Duration.ofMillis(10));
136+
when(profile.getDuration(highest)).thenReturn(Duration.ofSeconds(1));
137+
when(profile.getInt(digits)).thenReturn(5);
135138
when(profile.isDefined(sla)).thenReturn(false);
136139
when(profile.getDurationList(sla))
137140
.thenReturn(Arrays.asList(Duration.ofMillis(100), Duration.ofMillis(500)));

0 commit comments

Comments
 (0)