From c57103bb750c669c5e9a0b825303775bf6084432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anarthal=20=28Rub=C3=A9n=20P=C3=A9rez=29?= <34971811+anarthal@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:13:36 +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(); }