Skip to content

Commit c57103b

Browse files
authored
Removed brittle checks in connection_pool_cancel test
These checks could cause false positive race conditions to be reported.
1 parent 8b2727f commit c57103b

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

test/thread_safety/connection_pool_cancel.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
#include <boost/mysql/pool_params.hpp>
1010

1111
#include <boost/asio/bind_executor.hpp>
12-
#include <boost/asio/cancel_after.hpp>
1312
#include <boost/asio/detached.hpp>
1413
#include <boost/asio/post.hpp>
1514
#include <boost/asio/thread_pool.hpp>
1615

17-
#include <chrono>
1816
#include <memory>
1917

2018
#include "tsan_pool_common.hpp"
@@ -31,7 +29,6 @@ void run(const char* hostname)
3129
// Setup
3230
asio::thread_pool ctx(8);
3331

34-
// Using cancel()
3532
for (int i = 0; i < 20; ++i)
3633
{
3734
// Create a pool
@@ -44,16 +41,6 @@ void run(const char* hostname)
4441
asio::post(asio::bind_executor(ctx.get_executor(), [pool]() { pool->cancel(); }));
4542
}
4643

47-
// Using per-operation cancellation
48-
for (int i = 0; i < 20; ++i)
49-
{
50-
// Create a pool
51-
mysql::connection_pool pool(ctx, create_pool_params(hostname, 10));
52-
53-
// Run the pool for a short period of time
54-
pool.async_run(asio::cancel_after(std::chrono::milliseconds(1), asio::detached));
55-
}
56-
5744
// Run
5845
ctx.join();
5946
}

0 commit comments

Comments
 (0)