| 941 | } |
| 942 | |
| 943 | TEST_F(AsyncStreamingReaderTest, AsyncReentrancy) { |
| 944 | constexpr int kNumRows = 16; |
| 945 | constexpr double kIoLatency = 1e-2; |
| 946 | |
| 947 | auto expected = GenerateTestCase(kNumRows); |
| 948 | parse_options_.explicit_schema = expected.schema; |
| 949 | parse_options_.unexpected_field_behavior = UnexpectedFieldBehavior::Error; |
| 950 | read_options_.block_size = expected.block_size; |
| 951 | |
| 952 | std::vector<Future<std::shared_ptr<RecordBatch>>> futures(expected.num_batches + 2); |
| 953 | ASSERT_OK_AND_ASSIGN(auto reader, MakeReader(expected.json, kIoLatency)); |
| 954 | EXPECT_EQ(reader->bytes_processed(), 0); |
| 955 | for (auto& future : futures) { |
| 956 | future = reader->ReadNextAsync(); |
| 957 | } |
| 958 | |
| 959 | ASSERT_FINISHES_OK_AND_ASSIGN(auto results, All(std::move(futures))); |
| 960 | EXPECT_EQ(reader->bytes_processed(), expected.json_size); |
| 961 | ASSERT_OK_AND_ASSIGN(auto batches, arrow::internal::UnwrapOrRaise(std::move(results))); |
| 962 | AssertBatchSequenceEquals(expected.batches, batches); |
| 963 | } |
| 964 | |
| 965 | TEST_F(AsyncStreamingReaderTest, FuturesOutliveReader) { |
| 966 | constexpr int kNumRows = 16; |
nothing calls this directly
no test coverage detected