Skip to content

Commit 007abe3

Browse files
committed
Fix tests.
1 parent 0530fb2 commit 007abe3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tiledb/common/thread_pool/test/unit_thread_pool.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,14 @@ size_t random_ms(size_t max = 3) {
9898
*/
9999
void wait_all(
100100
ThreadPool& pool, bool use_wait, std::vector<ThreadPool::Task>& results) {
101+
// Do not use REQUIRE_NOTHROW here; it will invoke more test code and Catch2's
102+
// checks are not reentrant.
101103
if (use_wait) {
102104
for (auto& r : results) {
103-
REQUIRE_NOTHROW(pool.wait(r));
105+
pool.wait(r);
104106
}
105107
} else {
106-
REQUIRE_NOTHROW(pool.wait_all(results));
108+
pool.wait_all(results);
107109
}
108110
}
109111

@@ -185,7 +187,7 @@ TEST_CASE(
185187

186188
// Because the thread pool has 2 threads, the first two will probably be
187189
// executing at this point, but some will still be queued.
188-
REQUIRE_THROWS(cancelable_tasks.cancel_all_tasks());
190+
REQUIRE_NOTHROW(cancelable_tasks.cancel_all_tasks());
189191
}
190192

191193
SECTION("- With cancellation callback") {
@@ -206,7 +208,7 @@ TEST_CASE(
206208

207209
// Because the thread pool has 2 threads, the first two will probably be
208210
// executing at this point, but some will still be queued.
209-
REQUIRE_THROWS(cancelable_tasks.cancel_all_tasks());
211+
REQUIRE_NOTHROW(cancelable_tasks.cancel_all_tasks());
210212
REQUIRE(num_cancelled == ((int64_t)tasks.size() - result));
211213
}
212214
}

0 commit comments

Comments
 (0)