From b6d9f1e1d13387f7ae6bc254cc5e668e5cfba8aa Mon Sep 17 00:00:00 2001 From: Ruben Perez Date: Mon, 4 Nov 2024 10:44:20 +0100 Subject: [PATCH] Removed brittle checks in connection_pool_cancel test These checks could cause false positive race conditions to be reported. --- test/thread_safety/connection_pool_cancel.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/test/thread_safety/connection_pool_cancel.cpp b/test/thread_safety/connection_pool_cancel.cpp index e39487309..87a93ac47 100644 --- a/test/thread_safety/connection_pool_cancel.cpp +++ b/test/thread_safety/connection_pool_cancel.cpp @@ -9,12 +9,10 @@ #include #include -#include #include #include #include -#include #include #include "tsan_pool_common.hpp" @@ -31,7 +29,6 @@ void run(const char* hostname) // Setup asio::thread_pool ctx(8); - // Using cancel() for (int i = 0; i < 20; ++i) { // Create a pool @@ -44,16 +41,6 @@ void run(const char* hostname) asio::post(asio::bind_executor(ctx.get_executor(), [pool]() { pool->cancel(); })); } - // Using per-operation cancellation - for (int i = 0; i < 20; ++i) - { - // Create a pool - mysql::connection_pool pool(ctx, create_pool_params(hostname, 10)); - - // Run the pool for a short period of time - pool.async_run(asio::cancel_after(std::chrono::milliseconds(1), asio::detached)); - } - // Run ctx.join(); }