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

Method TestUndrained

cpp/src/arrow/flight/test_definitions.cc:865–885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

863 CheckBatches(descr, {batch1, batch2});
864}
865void DoPutTest::TestUndrained() {
866 // Ensure if the application doesn't drain all messages, that the
867 // server/transport does
868
869 auto descr = FlightDescriptor::Command("TestUndrained");
870 auto schema = arrow::schema({arrow::field("ints", int64())});
871 ASSERT_OK_AND_ASSIGN(auto do_put_result, client_->DoPut(descr, schema));
872 std::unique_ptr<FlightStreamWriter> writer = std::move(do_put_result.writer);
873 std::unique_ptr<FlightMetadataReader> reader = std::move(do_put_result.reader);
874 auto batch = RecordBatchFromJSON(schema, "[[1], [2], [3], [4]]");
875 // These calls may or may not fail depending on how quickly the
876 // transport reacts, whether it batches, writes, etc.
877 ARROW_UNUSED(writer->WriteRecordBatch(*batch));
878 ARROW_UNUSED(writer->WriteRecordBatch(*batch));
879 ARROW_UNUSED(writer->WriteRecordBatch(*batch));
880 ARROW_UNUSED(writer->WriteRecordBatch(*batch));
881 ASSERT_OK(writer->Close());
882
883 // We should be able to make another call
884 CheckDoPut(FlightDescriptor::Command("foo"), schema, {batch, batch});
885}
886
887//------------------------------------------------------------
888// Test app_metadata in data plane methods

Callers

nothing calls this directly

Calls 6

RecordBatchFromJSONFunction · 0.85
CommandFunction · 0.70
schemaFunction · 0.50
fieldFunction · 0.50
WriteRecordBatchMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected