Skip to content

Commit

Permalink
Fix vhost test flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
drbasic committed Feb 3, 2025
1 parent 251f1d6 commit d382677
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cloud/blockstore/vhost-server/server_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,21 @@ class TServerTest
TSimpleStats prevStats;
TCompleteStats stats;
for (int i = 0; i != 5; ++i) {
// Save critical events from previous attempt.
auto critEvents = std::move(stats.CriticalEvents);

stats = Server->GetStats(prevStats);

// Combine critical events from previous and current attempt.
if (critEvents) {
for (auto& critEvent: stats.CriticalEvents) {
critEvents.push_back(std::move(critEvent));
}
stats.CriticalEvents = std::move(critEvents);
}

// Check that the current attempt to get statistics has brought
// everything we need.
if (func(stats)) {
break;
}
Expand Down

0 comments on commit d382677

Please sign in to comment.