|
|
@ -153,14 +153,14 @@ std::unique_ptr<ScenarioResult> RunScenario( |
|
|
|
// where class contained in std::vector must have a copy constructor
|
|
|
|
// where class contained in std::vector must have a copy constructor
|
|
|
|
auto* servers = new ServerData[num_servers]; |
|
|
|
auto* servers = new ServerData[num_servers]; |
|
|
|
for (size_t i = 0; i < num_servers; i++) { |
|
|
|
for (size_t i = 0; i < num_servers; i++) { |
|
|
|
servers[i].stub = std::move( |
|
|
|
servers[i].stub = Worker::NewStub(CreateChannel(workers[i], |
|
|
|
Worker::NewStub(CreateChannel(workers[i], InsecureCredentials()))); |
|
|
|
InsecureCredentials())); |
|
|
|
ServerArgs args; |
|
|
|
ServerArgs args; |
|
|
|
result_server_config = server_config; |
|
|
|
result_server_config = server_config; |
|
|
|
result_server_config.set_host(workers[i]); |
|
|
|
result_server_config.set_host(workers[i]); |
|
|
|
*args.mutable_setup() = server_config; |
|
|
|
*args.mutable_setup() = server_config; |
|
|
|
servers[i].stream = |
|
|
|
servers[i].stream = |
|
|
|
std::move(servers[i].stub->RunServer(runsc::AllocContext(&contexts))); |
|
|
|
servers[i].stub->RunServer(runsc::AllocContext(&contexts)); |
|
|
|
GPR_ASSERT(servers[i].stream->Write(args)); |
|
|
|
GPR_ASSERT(servers[i].stream->Write(args)); |
|
|
|
ServerStatus init_status; |
|
|
|
ServerStatus init_status; |
|
|
|
GPR_ASSERT(servers[i].stream->Read(&init_status)); |
|
|
|
GPR_ASSERT(servers[i].stream->Read(&init_status)); |
|
|
@ -181,14 +181,14 @@ std::unique_ptr<ScenarioResult> RunScenario( |
|
|
|
// where class contained in std::vector must have a copy constructor
|
|
|
|
// where class contained in std::vector must have a copy constructor
|
|
|
|
auto* clients = new ClientData[num_clients]; |
|
|
|
auto* clients = new ClientData[num_clients]; |
|
|
|
for (size_t i = 0; i < num_clients; i++) { |
|
|
|
for (size_t i = 0; i < num_clients; i++) { |
|
|
|
clients[i].stub = std::move(Worker::NewStub( |
|
|
|
clients[i].stub = Worker::NewStub(CreateChannel(workers[i + num_servers], |
|
|
|
CreateChannel(workers[i + num_servers], InsecureCredentials()))); |
|
|
|
InsecureCredentials())); |
|
|
|
ClientArgs args; |
|
|
|
ClientArgs args; |
|
|
|
result_client_config = client_config; |
|
|
|
result_client_config = client_config; |
|
|
|
result_client_config.set_host(workers[i + num_servers]); |
|
|
|
result_client_config.set_host(workers[i + num_servers]); |
|
|
|
*args.mutable_setup() = client_config; |
|
|
|
*args.mutable_setup() = client_config; |
|
|
|
clients[i].stream = |
|
|
|
clients[i].stream = |
|
|
|
std::move(clients[i].stub->RunTest(runsc::AllocContext(&contexts))); |
|
|
|
clients[i].stub->RunTest(runsc::AllocContext(&contexts)); |
|
|
|
GPR_ASSERT(clients[i].stream->Write(args)); |
|
|
|
GPR_ASSERT(clients[i].stream->Write(args)); |
|
|
|
ClientStatus init_status; |
|
|
|
ClientStatus init_status; |
|
|
|
GPR_ASSERT(clients[i].stream->Read(&init_status)); |
|
|
|
GPR_ASSERT(clients[i].stream->Read(&init_status)); |
|
|
|