aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2016-01-27 10:44:06 -0800
committerGravatar Jan Tattermusch <jtattermusch@google.com>2016-01-27 10:44:06 -0800
commit5b3f7724329108a6f3bc252ad26942e1df04a255 (patch)
tree532530cb1994ab5da93b8aa65febf184b1524f7a
parent07fb042d25d69b765d7466b837dd89c6e387044d (diff)
parent6b6982bde37911fbcefa0e6299840d998d600b85 (diff)
Merge remote-tracking branch 'upstream/master' into run_tests_refactor
-rw-r--r--include/grpc++/server.h2
-rw-r--r--src/node/ext/byte_buffer.cc4
-rw-r--r--test/cpp/qps/driver.cc6
-rw-r--r--test/cpp/qps/qps_worker.cc22
-rwxr-xr-xtools/run_tests/build_node.sh2
5 files changed, 31 insertions, 5 deletions
diff --git a/include/grpc++/server.h b/include/grpc++/server.h
index c9371ba649..f24ed333bb 100644
--- a/include/grpc++/server.h
+++ b/include/grpc++/server.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/node/ext/byte_buffer.cc b/src/node/ext/byte_buffer.cc
index c306292c04..ee703fdc91 100644
--- a/src/node/ext/byte_buffer.cc
+++ b/src/node/ext/byte_buffer.cc
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -69,7 +69,7 @@ Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) {
return scope.Escape(Nan::Null());
}
size_t length = grpc_byte_buffer_length(buffer);
- char *result = reinterpret_cast<char *>(calloc(length, sizeof(char)));
+ char *result = new char[length];
size_t offset = 0;
grpc_byte_buffer_reader reader;
grpc_byte_buffer_reader_init(&reader, buffer);
diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc
index acb265b308..66269ae757 100644
--- a/test/cpp/qps/driver.cc
+++ b/test/cpp/qps/driver.cc
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -161,6 +161,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
// where class contained in std::vector must have a copy constructor
auto* servers = new ServerData[num_servers];
for (size_t i = 0; i < num_servers; i++) {
+ gpr_log(GPR_INFO, "Starting server on %s (worker #%d)", workers[i].c_str(),
+ i);
servers[i].stub = WorkerService::NewStub(
CreateChannel(workers[i], InsecureChannelCredentials()));
ServerArgs args;
@@ -188,6 +190,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
// where class contained in std::vector must have a copy constructor
auto* clients = new ClientData[num_clients];
for (size_t i = 0; i < num_clients; i++) {
+ gpr_log(GPR_INFO, "Starting client on %s (worker #%d)",
+ workers[i + num_servers].c_str(), i + num_servers);
clients[i].stub = WorkerService::NewStub(
CreateChannel(workers[i + num_servers], InsecureChannelCredentials()));
ClientArgs args;
diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc
index c0276d05b3..e782b2a6c5 100644
--- a/test/cpp/qps/qps_worker.cc
+++ b/test/cpp/qps/qps_worker.cc
@@ -61,6 +61,11 @@ namespace grpc {
namespace testing {
static std::unique_ptr<Client> CreateClient(const ClientConfig& config) {
+ gpr_log(GPR_INFO, "Starting client of type %s %s %d",
+ ClientType_Name(config.client_type()).c_str(),
+ RpcType_Name(config.rpc_type()).c_str(),
+ config.payload_config().has_bytebuf_params());
+
switch (config.client_type()) {
case ClientType::SYNC_CLIENT:
return (config.rpc_type() == RpcType::UNARY)
@@ -81,6 +86,9 @@ static std::unique_ptr<Client> CreateClient(const ClientConfig& config) {
static void LimitCores(int cores) {}
static std::unique_ptr<Server> CreateServer(const ServerConfig& config) {
+ gpr_log(GPR_INFO, "Starting server of type %s",
+ ServerType_Name(config.server_type()).c_str());
+
if (config.core_limit() > 0) {
LimitCores(config.core_limit());
}
@@ -169,22 +177,29 @@ class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
if (!args.has_setup()) {
return Status(StatusCode::INVALID_ARGUMENT, "");
}
+ gpr_log(GPR_INFO, "RunClientBody: about to create client");
auto client = CreateClient(args.setup());
if (!client) {
return Status(StatusCode::INVALID_ARGUMENT, "");
}
+ gpr_log(GPR_INFO, "RunClientBody: client created");
ClientStatus status;
if (!stream->Write(status)) {
return Status(StatusCode::UNKNOWN, "");
}
+ gpr_log(GPR_INFO, "RunClientBody: creation status reported");
while (stream->Read(&args)) {
+ gpr_log(GPR_INFO, "RunClientBody: Message read");
if (!args.has_mark()) {
+ gpr_log(GPR_INFO, "RunClientBody: Message is not a mark!");
return Status(StatusCode::INVALID_ARGUMENT, "");
}
*status.mutable_stats() = client->Mark(args.mark().reset());
stream->Write(status);
+ gpr_log(GPR_INFO, "RunClientBody: Mark response given");
}
+ gpr_log(GPR_INFO, "RunClientBody: Returning");
return Status::OK;
}
@@ -200,24 +215,31 @@ class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
if (server_port_ != 0) {
args.mutable_setup()->set_port(server_port_);
}
+ gpr_log(GPR_INFO, "RunServerBody: about to create server");
auto server = CreateServer(args.setup());
if (!server) {
return Status(StatusCode::INVALID_ARGUMENT, "");
}
+ gpr_log(GPR_INFO, "RunServerBody: server created");
ServerStatus status;
status.set_port(server->port());
status.set_cores(server->cores());
if (!stream->Write(status)) {
return Status(StatusCode::UNKNOWN, "");
}
+ gpr_log(GPR_INFO, "RunServerBody: creation status reported");
while (stream->Read(&args)) {
+ gpr_log(GPR_INFO, "RunServerBody: Message read");
if (!args.has_mark()) {
+ gpr_log(GPR_INFO, "RunServerBody: Message not a mark!");
return Status(StatusCode::INVALID_ARGUMENT, "");
}
*status.mutable_stats() = server->Mark(args.mark().reset());
stream->Write(status);
+ gpr_log(GPR_INFO, "RunServerBody: Mark response given");
}
+ gpr_log(GPR_INFO, "RunServerBody: Returning");
return Status::OK;
}
diff --git a/tools/run_tests/build_node.sh b/tools/run_tests/build_node.sh
index b856b97942..8f2ab4413a 100755
--- a/tools/run_tests/build_node.sh
+++ b/tools/run_tests/build_node.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright 2015, Google Inc.
+# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without