Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SynchronousMetricStorageTest flake #5981

Merged
merged 3 commits into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -413,16 +413,15 @@ void recordAndCollect_concurrentStressTest(
// If we terminate when latch.count() == 0, the last collect may have occurred before
// the last recorded measurement. To ensure we collect all measurements, we collect
// one extra time after latch.count() == 0.
while (latch.getCount() != 0 && extraCollects <= 1) {
while (latch.getCount() != 0 || extraCollects <= 1) {
breedx-splk marked this conversation as resolved.
Show resolved Hide resolved
Uninterruptibles.sleepUninterruptibly(Duration.ofMillis(1));
MetricData metricData =
storage.collect(Resource.empty(), InstrumentationScopeInfo.empty(), 0, 1);
if (metricData.isEmpty()) {
continue;
if (!metricData.isEmpty()) {
metricData.getDoubleSumData().getPoints().stream()
.findFirst()
.ifPresent(pointData -> collect.accept(pointData.getValue(), cumulativeSum));
}
metricData.getDoubleSumData().getPoints().stream()
.findFirst()
.ifPresent(pointData -> collect.accept(pointData.getValue(), cumulativeSum));
if (latch.getCount() == 0) {
extraCollects++;
}
Expand Down