Skip to content

Commit 29da6de

Browse files
authored
chore(fix): unflake MetricsTracerTest (#313)
* chore(fix): unflake MetricsTracerTest * chore(fix): unflake MetricsTracerTest * chore(fix): unflake MetricsTracerTest * chore(fix): unflake MetricsTracerTest * review feedback * review feedback
1 parent 7f61f90 commit 29da6de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsTracerTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,10 @@ public Object answer(InvocationOnMock invocation) throws Throwable {
237237
getAggregationValueAsLong(
238238
RpcViewConstants.BIGTABLE_READ_ROWS_FIRST_ROW_LATENCY_VIEW,
239239
ImmutableMap.<TagKey, TagValue>of());
240-
assertThat(firstRowLatency).isIn(Range.closed(beforeSleep, elapsed - afterSleep));
240+
241+
// adding buffer time to the upper range to allow for a race between the emulator and the client
242+
// recording the duration
243+
assertThat(firstRowLatency).isIn(Range.closed(beforeSleep, elapsed - afterSleep / 2));
241244
}
242245

243246
@Test

0 commit comments

Comments
 (0)