MCPcopy Create free account
hub / github.com/apache/arrow / TEST_F

Function TEST_F

cpp/src/arrow/json/reader_test.cc:950–970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

948}
949
950TEST_F(AsyncStreamingReaderTest, AsyncReentrancy) {
951 constexpr int kNumRows = 16;
952 constexpr double kIoLatency = 1e-2;
953
954 auto expected = GenerateTestCase(kNumRows);
955 parse_options_.explicit_schema = expected.schema;
956 parse_options_.unexpected_field_behavior = UnexpectedFieldBehavior::Error;
957 read_options_.block_size = expected.block_size;
958
959 std::vector<Future<std::shared_ptr<RecordBatch>>> futures(expected.num_batches + 2);
960 ASSERT_OK_AND_ASSIGN(auto reader, MakeReader(expected.json, kIoLatency));
961 EXPECT_EQ(reader->bytes_processed(), 0);
962 for (auto& future : futures) {
963 future = reader->ReadNextAsync();
964 }
965
966 ASSERT_FINISHES_OK_AND_ASSIGN(auto results, All(std::move(futures)));
967 EXPECT_EQ(reader->bytes_processed(), expected.json_size);
968 ASSERT_OK_AND_ASSIGN(auto batches, internal::UnwrapOrRaise(std::move(results)));
969 AssertBatchSequenceEquals(expected.batches, batches);
970}
971
972TEST_F(AsyncStreamingReaderTest, FuturesOutliveReader) {
973 constexpr int kNumRows = 16;

Callers

nothing calls this directly

Calls 4

bytes_processedMethod · 0.80
IOContextClass · 0.50
ReadNextAsyncMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected