[testing] Add StopListening helper and BidiStream handler to XDS e2e test lib (#35861)

As title. Pulling these additions out from a larger change.

Related: cl/563857636

Closes #35861

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35861 from apolcyn:xds_test_changes a67f64d93c
PiperOrigin-RevId: 607728140
test_607737361
apolcyn 1 year ago committed by Copybara-Service
parent 6f406a7a68
commit b855423359
  1. 10
      test/cpp/end2end/xds/xds_end2end_test_lib.cc
  2. 2
      test/cpp/end2end/xds/xds_end2end_test_lib.h

@ -171,6 +171,16 @@ void XdsEnd2endTest::ServerThread::StopListeningAndSendGoaways() {
gpr_log(GPR_INFO, "%s done sending GOAWAYs", Type());
}
void XdsEnd2endTest::ServerThread::StopListening() {
gpr_log(GPR_INFO, "%s about to stop listening", Type());
{
grpc_core::ExecCtx exec_ctx;
auto* server = grpc_core::Server::FromC(server_->c_server());
server->StopListening();
}
gpr_log(GPR_INFO, "%s stopped listening", Type());
}
void XdsEnd2endTest::ServerThread::Serve(grpc_core::Mutex* mu,
grpc_core::CondVar* cond) {
// We need to acquire the lock here in order to prevent the notify_one

@ -259,6 +259,8 @@ class XdsEnd2endTest : public ::testing::TestWithParam<XdsTestType>,
allow_put_requests_ = allow_put_requests;
}
void StopListening();
void StopListeningAndSendGoaways();
private:

Loading…
Cancel
Save