MCPcopy Create free account
hub / github.com/apache/brpc / TestConnectionFailedParallel

Method TestConnectionFailedParallel

test/brpc_channel_unittest.cpp:412–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410 }
411
412 void TestConnectionFailedParallel(bool single_server, bool async,
413 bool short_connection) {
414 std::cout << " *** single=" << single_server
415 << " async=" << async
416 << " short=" << short_connection << std::endl;
417
418 const size_t NCHANS = 8;
419 brpc::Channel subchans[NCHANS];
420 brpc::ParallelChannel channel;
421 for (size_t i = 0; i < NCHANS; ++i) {
422 SetUpChannel(&subchans[i], single_server, short_connection);
423 ASSERT_EQ(0, channel.AddChannel(
424 &subchans[i], brpc::DOESNT_OWN_CHANNEL,
425 NULL, NULL));
426 }
427
428 brpc::Controller cntl;
429 test::EchoRequest req;
430 test::EchoResponse res;
431 req.set_message(__FUNCTION__);
432 CallMethod(&channel, &cntl, &req, &res, async);
433
434 EXPECT_TRUE(brpc::ETOOMANYFAILS == cntl.ErrorCode() ||
435 ECONNREFUSED == cntl.ErrorCode()) << cntl.ErrorText();
436 LOG(INFO) << cntl.ErrorText();
437 }
438
439 void TestConnectionFailedSelective(bool single_server, bool async,
440 bool short_connection) {

Callers

nothing calls this directly

Calls 3

ErrorCodeMethod · 0.80
ErrorTextMethod · 0.80
AddChannelMethod · 0.45

Tested by

no test coverage detected