| 926 | } |
| 927 | |
| 928 | TEST_F(AsyncStreamingReaderTest, AsyncReentrancy) { |
| 929 | constexpr int kNumRows = 16; |
| 930 | constexpr double kIoLatency = 1e-2; |
| 931 | |
| 932 | auto expected = GenerateTestCase(kNumRows); |
| 933 | parse_options_.explicit_schema = expected.schema; |
| 934 | parse_options_.unexpected_field_behavior = UnexpectedFieldBehavior::Error; |
| 935 | read_options_.block_size = expected.block_size; |
| 936 | |
| 937 | std::vector<Future<std::shared_ptr<RecordBatch>>> futures(expected.num_batches + 2); |
| 938 | ASSERT_OK_AND_ASSIGN(auto reader, MakeReader(expected.json, kIoLatency)); |
| 939 | EXPECT_EQ(reader->bytes_processed(), 0); |
| 940 | for (auto& future : futures) { |
| 941 | future = reader->ReadNextAsync(); |
| 942 | } |
| 943 | |
| 944 | ASSERT_FINISHES_OK_AND_ASSIGN(auto results, All(std::move(futures))); |
| 945 | EXPECT_EQ(reader->bytes_processed(), expected.json_size); |
| 946 | ASSERT_OK_AND_ASSIGN(auto batches, internal::UnwrapOrRaise(std::move(results))); |
| 947 | AssertBatchSequenceEquals(expected.batches, batches); |
| 948 | } |
| 949 | |
| 950 | TEST_F(AsyncStreamingReaderTest, FuturesOutliveReader) { |
| 951 | constexpr int kNumRows = 16; |
nothing calls this directly
no test coverage detected