Skip to content

Commit

Permalink
tests/unit/metrics_tester: use deferred_stop() when appropriate
Browse files Browse the repository at this point in the history
simpler this way.

Signed-off-by: Kefu Chai <[email protected]>

Closes #2241
  • Loading branch information
tchaikov authored and xemul committed May 15, 2024
1 parent 998d299 commit bb14305
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/unit/metrics_tester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <seastar/core/metrics.hh>
#include <seastar/core/relabel_config.hh>
#include <seastar/core/internal/estimated_histogram.hh>
#include <seastar/util/defer.hh>
#include <seastar/util/closeable.hh>
#include "../../apps/lib/stop_signal.hh"
#include <map>
#include <vector>
Expand Down Expand Up @@ -173,9 +173,7 @@ int main(int ac, char** av) {
}

prometheus_server.start("prometheus").get();
auto stop_server = defer([&] () noexcept {
prometheus_server.stop().get();
});
auto stop_server = deferred_stop(prometheus_server);

prometheus::config pctx;
pctx.allow_protobuf = true;
Expand Down

0 comments on commit bb14305

Please sign in to comment.