| 67 | }; |
| 68 | |
| 69 | void SetUp() override { |
| 70 | fs::TimePoint mock_now = std::chrono::system_clock::now(); |
| 71 | ASSERT_OK_AND_ASSIGN(std::shared_ptr<fs::FileSystem> fs, |
| 72 | MockFileSystem::Make(mock_now, {::arrow::fs::Dir("testdir")})); |
| 73 | filesystem_ = std::dynamic_pointer_cast<MockFileSystem>(fs); |
| 74 | schema_ = schema({field("int64", int64())}); |
| 75 | write_options_.filesystem = filesystem_; |
| 76 | write_options_.basename_template = "chunk-{i}.arrow"; |
| 77 | write_options_.base_dir = "testdir"; |
| 78 | write_options_.writer_pre_finish = [this](FileWriter* writer) { |
| 79 | pre_finish_visited_.push_back(writer->destination().path); |
| 80 | return Status::OK(); |
| 81 | }; |
| 82 | write_options_.writer_post_finish = [this](FileWriter* writer) { |
| 83 | post_finish_visited_.push_back(writer->destination().path); |
| 84 | return Status::OK(); |
| 85 | }; |
| 86 | std::shared_ptr<FileFormat> format = std::make_shared<IpcFileFormat>(); |
| 87 | write_options_.file_write_options = format->DefaultWriteOptions(); |
| 88 | scheduler_finished_ = |
| 89 | util::AsyncTaskScheduler::Make([&](util::AsyncTaskScheduler* scheduler) { |
| 90 | scheduler_ = scheduler; |
| 91 | scheduler->AddSimpleTask( |
| 92 | [&] { return test_done_with_tasks_; }, |
| 93 | "DatasetWriterTestFixture::WaitForTestMethodToFinish"sv); |
| 94 | return Status::OK(); |
| 95 | }); |
| 96 | } |
| 97 | |
| 98 | void TearDown() override { |
| 99 | if (!test_done_with_tasks_.is_finished()) { |
nothing calls this directly
no test coverage detected