Skip to content

Commit

Permalink
Remove thread pool assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Dec 13, 2024
1 parent 3aaec05 commit c115540
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions cpp/src/arrow/dataset/file_parquet_encryption_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,23 +168,15 @@ class DatasetEncryptionTestBase : public testing::TestWithParam<EncryptionParam>
ASSERT_OK_AND_ASSIGN(auto dataset, dataset_factory->Finish());

if (concurrently) {
// start with a single thread so we are more likely to build up a queue of jobs
ASSERT_OK_AND_ASSIGN(auto pool, arrow::internal::ThreadPool::Make(1));
// have a notable number of threads to exhibit multi-threading issues
ASSERT_OK_AND_ASSIGN(auto pool, arrow::internal::ThreadPool::Make(16));
std::vector<Future<std::shared_ptr<Table>>> threads;

// Read dataset above multiple times concurrently to see that is thread-safe.
for (size_t i = 0; i < 100; ++i) {
threads.push_back(
DeferNotOk(pool->Submit(DatasetEncryptionTestBase::read, dataset)));
}

// ramp up parallelism
ASSERT_OK(pool->SetCapacity(16));
// ensure there are sufficient jobs to see concurrent processing
ASSERT_GT(pool->GetNumTasks(), 16);
printf("%d", pool->GetNumTasks());

// wait for all jobs to finish
pool->WaitForIdle();

// assert correctness of jobs
Expand Down

0 comments on commit c115540

Please sign in to comment.