Skip to content

Commit a747aea

Browse files
committed
Fix tests.
1 parent 0530fb2 commit a747aea

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
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
}

tiledb/sm/filter/test/unit_encryption_pipeline.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ TEST_CASE("Filter: Test encryption", "[filter][encryption]") {
5454
pipeline.add_filter(EncryptionAES256GCMFilter(Datatype::UINT64));
5555

5656
// No key set
57-
CHECK(!pipeline.run_forward(&dummy_stats, tile.get(), nullptr, &tp).ok());
57+
CHECK_THROWS(throw_if_not_ok(
58+
pipeline.run_forward(&dummy_stats, tile.get(), nullptr, &tp)));
5859

5960
// Create and set a key
6061
char key[32];

tiledb/sm/filter/test/unit_positive_delta_pipeline.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ TEST_CASE("Filter: Test positive-delta encoding", "[filter][positive-delta]") {
123123
CHECK_NOTHROW(tile->write(&val, i * sizeof(uint64_t), sizeof(uint64_t)));
124124
}
125125

126-
CHECK(!pipeline.run_forward(&dummy_stats, tile.get(), nullptr, &tp).ok());
126+
CHECK_THROWS(throw_if_not_ok(
127+
pipeline.run_forward(&dummy_stats, tile.get(), nullptr, &tp)));
127128
}
128129
}
129130

@@ -277,9 +278,8 @@ TEST_CASE(
277278
CHECK_NOTHROW(tile->write(&val, i * sizeof(uint64_t), sizeof(uint64_t)));
278279
}
279280

280-
CHECK(
281-
!pipeline.run_forward(&dummy_stats, tile.get(), offsets_tile.get(), &tp)
282-
.ok());
281+
CHECK_THROWS(throw_if_not_ok(pipeline.run_forward(
282+
&dummy_stats, tile.get(), offsets_tile.get(), &tp)));
283283
}
284284

285285
WhiteboxWriterTile::set_max_tile_chunk_size(constants::max_tile_chunk_size);

0 commit comments

Comments
 (0)