From 098084314e87e1acec8c9965dad05548103249d1 Mon Sep 17 00:00:00 2001 From: Tyler Neely Date: Thu, 17 Nov 2022 21:22:41 +0000 Subject: [PATCH] Make TestAddress deterministically sortable --- src/io/address.hpp | 2 +- tests/simulation/basic_request.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/io/address.hpp b/src/io/address.hpp index a6e372edb..533b62bcc 100644 --- a/src/io/address.hpp +++ b/src/io/address.hpp @@ -59,7 +59,7 @@ struct Address { static Address TestAddress(uint16_t port) { return Address{ - .unique_id = boost::uuids::uuid{boost::uuids::random_generator()()}, + .unique_id = boost::uuids::uuid{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, static_cast(port)}, .last_known_port = port, }; } diff --git a/tests/simulation/basic_request.cpp b/tests/simulation/basic_request.cpp index 27f083273..868f4ac10 100644 --- a/tests/simulation/basic_request.cpp +++ b/tests/simulation/basic_request.cpp @@ -109,11 +109,11 @@ int main() { auto [sim_stats_2, latency_stats_2] = RunWorkload(config); if (sim_stats_1 != sim_stats_2 || latency_stats_1 != latency_stats_2) { - spdlog::info("simulator stats diverged across runs"); - spdlog::info("run 1 simulator stats: {}", sim_stats_1); - spdlog::info("run 2 simulator stats: {}", sim_stats_2); - spdlog::info("run 1 latency:\n{}", latency_stats_1.SummaryTable()); - spdlog::info("run 2 latency:\n{}", latency_stats_2.SummaryTable()); + spdlog::error("simulator stats diverged across runs"); + spdlog::error("run 1 simulator stats: {}", sim_stats_1); + spdlog::error("run 2 simulator stats: {}", sim_stats_2); + spdlog::error("run 1 latency:\n{}", latency_stats_1.SummaryTable()); + spdlog::error("run 2 latency:\n{}", latency_stats_2.SummaryTable()); std::terminate(); }