Skip to content

Commit 41cb18b

Browse files
author
kgershov
committed
fix flapping test SplitRateHistogramIntoGauges
commit_hash:077308ad52c3118924040539045fac3f50865b32
1 parent 4d16852 commit 41cb18b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

yt/yt/library/profiling/unittests/exporter_ut.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ TEST(TSolomonExporterTest, SplitRateHistogramIntoGauges)
114114
hist.Record(TDuration::MilliSeconds(500));
115115
hist.Record(TDuration::MilliSeconds(500));
116116
hist.Record(TDuration::MilliSeconds(500));
117-
Sleep(TDuration::Seconds(6));
117+
auto alignedNow = TInstant::Seconds((TInstant::Now().Seconds() / 5) * 5);
118+
// Wait one second after the next tick to ensure the value is ready.
119+
SleepUntil(alignedNow + TDuration::Seconds(6));
118120

119121
auto options = TReadOptions{
120122
.ConvertCountersToRateGauge = true,

0 commit comments

Comments
 (0)