aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-11-02 08:42:49 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-11-02 08:42:49 -0700
commit6c8492de8a27b3b6afa3533543eeac167b5c94cc (patch)
treed487ad8a8745abfe706a92b31a5a1c54f866aead /test
parentf464a3700d3ca78fc35b2f3bd69c71883a849843 (diff)
parent57f30d15185f030de0c71d6a39e533d418b2a22e (diff)
Merge remote-tracking branch 'upstream/master' into remove_fake_resolver
Diffstat (limited to 'test')
-rw-r--r--test/core/end2end/tests/resource_quota_server.c39
-rw-r--r--test/cpp/grpclb/grpclb_test.cc18
-rw-r--r--test/cpp/util/proto_reflection_descriptor_database.h7
3 files changed, 43 insertions, 21 deletions
diff --git a/test/core/end2end/tests/resource_quota_server.c b/test/core/end2end/tests/resource_quota_server.c
index d2e3efb5d7..35f200b75f 100644
--- a/test/core/end2end/tests/resource_quota_server.c
+++ b/test/core/end2end/tests/resource_quota_server.c
@@ -137,17 +137,22 @@ void resource_quota_server(grpc_end2end_test_config config) {
* will be verified on completion. */
gpr_slice request_payload_slice = generate_random_slice();
- grpc_call *client_calls[NUM_CALLS];
- grpc_call *server_calls[NUM_CALLS];
- grpc_metadata_array initial_metadata_recv[NUM_CALLS];
- grpc_metadata_array trailing_metadata_recv[NUM_CALLS];
- grpc_metadata_array request_metadata_recv[NUM_CALLS];
- grpc_call_details call_details[NUM_CALLS];
- grpc_status_code status[NUM_CALLS];
- char *details[NUM_CALLS];
- size_t details_capacity[NUM_CALLS];
- grpc_byte_buffer *request_payload_recv[NUM_CALLS];
- int was_cancelled[NUM_CALLS];
+ grpc_call **client_calls = malloc(sizeof(grpc_call *) * NUM_CALLS);
+ grpc_call **server_calls = malloc(sizeof(grpc_call *) * NUM_CALLS);
+ grpc_metadata_array *initial_metadata_recv =
+ malloc(sizeof(grpc_metadata_array) * NUM_CALLS);
+ grpc_metadata_array *trailing_metadata_recv =
+ malloc(sizeof(grpc_metadata_array) * NUM_CALLS);
+ grpc_metadata_array *request_metadata_recv =
+ malloc(sizeof(grpc_metadata_array) * NUM_CALLS);
+ grpc_call_details *call_details =
+ malloc(sizeof(grpc_call_details) * NUM_CALLS);
+ grpc_status_code *status = malloc(sizeof(grpc_status_code) * NUM_CALLS);
+ char **details = malloc(sizeof(char *) * NUM_CALLS);
+ size_t *details_capacity = malloc(sizeof(size_t) * NUM_CALLS);
+ grpc_byte_buffer **request_payload_recv =
+ malloc(sizeof(grpc_byte_buffer *) * NUM_CALLS);
+ int *was_cancelled = malloc(sizeof(int) * NUM_CALLS);
grpc_call_error error;
int pending_client_calls = 0;
int pending_server_start_calls = 0;
@@ -356,6 +361,18 @@ void resource_quota_server(grpc_end2end_test_config config) {
gpr_slice_unref(request_payload_slice);
grpc_resource_quota_unref(resource_quota);
+ free(client_calls);
+ free(server_calls);
+ free(initial_metadata_recv);
+ free(trailing_metadata_recv);
+ free(request_metadata_recv);
+ free(call_details);
+ free(status);
+ free(details);
+ free(details_capacity);
+ free(request_payload_recv);
+ free(was_cancelled);
+
end_test(&f);
config.tear_down_data(&f);
}
diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc
index c67249e4b1..70d50ec2fa 100644
--- a/test/cpp/grpclb/grpclb_test.cc
+++ b/test/cpp/grpclb/grpclb_test.cc
@@ -76,10 +76,22 @@ extern "C" {
// - Send a serverlist with faulty ip:port addresses (port > 2^16, etc).
// - Test reception of invalid serverlist
// - Test pinging
-// - Test against a non-LB server. That server should return UNIMPLEMENTED and
-// the call should fail.
+// - Test against a non-LB server.
// - Random LB server closing the stream unexpectedly.
// - Test using DNS-resolvable names (localhost?)
+//
+// Findings from end to end testing to be covered here:
+// - Handling of LB servers restart, including reconnection after backing-off
+// retries.
+// - Destruction of load balanced channel (and therefore of grpclb instance)
+// while:
+// 1) the internal LB call is still active. This should work by virtue
+// of the weak reference the LB call holds. The call should be terminated as
+// part of the grpclb shutdown process.
+// 2) the retry timer is active. Again, the weak reference it holds should
+// prevent a premature call to \a glb_destroy.
+// - Restart of backend servers with no changes to serverlist. This exercises
+// the RR handover mechanism.
namespace grpc {
namespace {
@@ -144,7 +156,6 @@ static gpr_slice build_response_payload_slice(
// disfunctional implementation of std::to_string in gcc 4.4, which doesn't
// have a version for int but does have one for long long int.
string token_data = "token" + std::to_string((long long int)ports[i]);
- token_data.resize(64, '-');
server->set_load_balance_token(token_data);
}
const grpc::string &enc_resp = response.SerializeAsString();
@@ -333,7 +344,6 @@ static void start_backend_server(server_fixture *sf) {
// disfunctional implementation of std::to_string in gcc 4.4, which doesn't
// have a version for int but does have one for long long int.
string expected_token = "token" + std::to_string((long long int)sf->port);
- expected_token.resize(64, '-');
GPR_ASSERT(contains_metadata(&request_metadata_recv, "lb-token",
expected_token.c_str()));
diff --git a/test/cpp/util/proto_reflection_descriptor_database.h b/test/cpp/util/proto_reflection_descriptor_database.h
index dfa36044d9..4637c043f1 100644
--- a/test/cpp/util/proto_reflection_descriptor_database.h
+++ b/test/cpp/util/proto_reflection_descriptor_database.h
@@ -38,14 +38,9 @@
#include <unordered_set>
#include <vector>
-// GRPC_NO_GENERATED_CODE indicates generated pb files should not be used
-#ifdef GRPC_NO_GENERATED_CODE
-#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h"
-#else
-#include <grpc++/ext/reflection.grpc.pb.h>
-#endif // GRPC_NO_GENERATED_CODE
#include <grpc++/grpc++.h>
#include <grpc++/impl/codegen/config_protobuf.h>
+#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h"
namespace grpc {