Skip to content

Commit

Permalink
add more Unbounded Queue Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
odygrd committed Nov 12, 2024
1 parent e9c6825 commit fe36429
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions test/integration_tests/MultiFrontendThreadsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ using namespace quill;
struct CustomFrontendOptions
{
static constexpr quill::QueueType queue_type = quill::QueueType::UnboundedBlocking;
static constexpr uint32_t initial_queue_capacity = 32;
static constexpr uint32_t initial_queue_capacity = 64;

static constexpr uint32_t blocking_queue_retry_interval_ns = 800;
static constexpr bool huge_pages_enabled = false;
Expand All @@ -32,16 +32,14 @@ using CustomFrontend = quill::FrontendImpl<CustomFrontendOptions>;
using CustomLogger = quill::LoggerImpl<CustomFrontendOptions>;

/***/
TEST_CASE("multi_frontend_threads_with_queue_reallocation")
TEST_CASE("multi_frontend_threads")
{
static constexpr size_t number_of_messages = 5000;
static constexpr size_t number_of_messages = 1500;
static constexpr size_t number_of_threads = 10;
static constexpr char const* filename = "multi_frontend_threads_with_queue_reallocation.log";
static constexpr char const* filename = "multi_frontend_threads.log";
static std::string const logger_name_prefix = "logger_";

// Start the logging backend thread with a bit of delay
BackendOptions bo;
bo.sleep_duration = std::chrono::seconds{20};
// Start the logging backend thread
Backend::start();

std::vector<std::thread> threads;
Expand Down Expand Up @@ -84,9 +82,6 @@ TEST_CASE("multi_frontend_threads_with_queue_reallocation")
elem.join();
}

// Wake up the backend thread after all other threads finished
Backend::notify();

// flush all log and remove all loggers
for (CustomLogger* logger : CustomFrontend::get_all_loggers())
{
Expand Down
2 changes: 1 addition & 1 deletion test/unit_tests/UnboundedQueueTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TEST_CASE("unbounded_queue_read_write_multithreaded_plain_ints")
}
}
});

std::thread consumer_thread(
[&buffer]()
{
Expand Down

0 comments on commit fe36429

Please sign in to comment.