Skip to content

Commit

Permalink
[FLINK-26809][tests] Assert histogram state after stopping the uploader
Browse files Browse the repository at this point in the history
There is a race condition in ChangelogStorageMetricsTest.testAttemptsPerUpload:
- the assertion is made as soon as upload (future) is completed
- the histogram is updated after completing the upload (on success)
Moving assertion out of try/close block solves the problem.
  • Loading branch information
rkhachatryan committed Mar 25, 2022
1 parent dc00dad commit 7e909ff
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ void testAttemptsPerUpload() throws Exception {
writer.append(0, new byte[] {0, 1, 2, 3});
writer.persist(from).get();
}
HistogramStatistics histogram = metrics.getAttemptsPerUpload().getStatistics();
assertThat(histogram.getMin()).isEqualTo(maxAttempts);
assertThat(histogram.getMax()).isEqualTo(maxAttempts);
} finally {
storage.close();
}
HistogramStatistics histogram = metrics.getAttemptsPerUpload().getStatistics();
assertThat(histogram.getMin()).isEqualTo(maxAttempts);
assertThat(histogram.getMax()).isEqualTo(maxAttempts);
}

@Test
Expand Down

0 comments on commit 7e909ff

Please sign in to comment.