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

Method TestDoExchangeUndrained

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

Source from the content-addressed store, hash-verified

603 ASSERT_OK(writer->Close());
604}
605void DataTest::TestDoExchangeUndrained() {
606 // Ensure if the application doesn't drain all messages, that the
607 // server/transport does
608
609 auto descr = FlightDescriptor::Command("TestUndrained");
610 auto schema = arrow::schema({arrow::field("ints", int64())});
611 ASSERT_OK_AND_ASSIGN(auto exchange, client_->DoExchange(descr));
612 std::unique_ptr<FlightStreamReader> reader = std::move(exchange.reader);
613 std::unique_ptr<FlightStreamWriter> writer = std::move(exchange.writer);
614
615 auto batch = RecordBatchFromJSON(schema, "[[1], [2], [3], [4]]");
616 ASSERT_OK(writer->Begin(schema));
617 // These calls may or may not fail depending on how quickly the
618 // transport reacts, whether it batches, writes, etc.
619 ARROW_UNUSED(writer->WriteRecordBatch(*batch));
620 ARROW_UNUSED(writer->WriteRecordBatch(*batch));
621 ARROW_UNUSED(writer->WriteRecordBatch(*batch));
622 ARROW_UNUSED(writer->WriteRecordBatch(*batch));
623 ASSERT_OK(writer->Close());
624
625 // We should be able to make another call
626 TestDoExchangeGet();
627}
628void DataTest::TestIssue5095() {
629 // Make sure the server-side error message is reflected to the
630 // client

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected