aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/core/end2end/h2_ssl_cert_test.cc16
-rw-r--r--test/core/tsi/ssl_transport_security_test.cc10
-rw-r--r--test/cpp/end2end/end2end_test.cc2
3 files changed, 24 insertions, 4 deletions
diff --git a/test/core/end2end/h2_ssl_cert_test.cc b/test/core/end2end/h2_ssl_cert_test.cc
index 3383d6d5d1..9adb96e926 100644
--- a/test/core/end2end/h2_ssl_cert_test.cc
+++ b/test/core/end2end/h2_ssl_cert_test.cc
@@ -272,6 +272,20 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return;
+ /* Perform a completion queue next, so that any pending operations can be
+ * finished, and resources can be released. This is so that, shutdown does not
+ * hang. For example, the server might be stuck in the handshaking code, which
+ * keeps a ref to a listener. Unless, it is unref'd, shutdown won't be able
+ * to proceed.
+ *
+ * (If shutdown times out, it is probably because 100ms wasn't enough. In that
+ * case, the deadline can be increased. Or, we could simply have another
+ * thread for the server to poll the completion queue while the shutdown
+ * progresses.)
+ */
+ GPR_ASSERT(grpc_completion_queue_next(
+ f->cq, grpc_timeout_milliseconds_to_deadline(100), nullptr)
+ .type == GRPC_QUEUE_TIMEOUT);
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
grpc_timeout_seconds_to_deadline(5),
@@ -288,8 +302,8 @@ static void shutdown_client(grpc_end2end_test_fixture* f) {
}
static void end_test(grpc_end2end_test_fixture* f) {
- shutdown_server(f);
shutdown_client(f);
+ shutdown_server(f);
grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq);
diff --git a/test/core/tsi/ssl_transport_security_test.cc b/test/core/tsi/ssl_transport_security_test.cc
index 8939c0434b..bf54383c54 100644
--- a/test/core/tsi/ssl_transport_security_test.cc
+++ b/test/core/tsi/ssl_transport_security_test.cc
@@ -667,9 +667,15 @@ int main(int argc, char** argv) {
ssl_tsi_test_do_handshake_with_server_name_indication_wild_star_domain();
ssl_tsi_test_do_handshake_with_bad_server_cert();
ssl_tsi_test_do_handshake_with_bad_client_cert();
- ssl_tsi_test_do_handshake_alpn_client_no_server();
+ // TODO: BoringSSL and OpenSSL have different behaviors on handling mismatched
+ // ALPN. Re-enable this test if we can detect in the runtime which SSL library
+ // is used.
+ // ssl_tsi_test_do_handshake_alpn_client_no_server();
ssl_tsi_test_do_handshake_alpn_server_no_client();
- ssl_tsi_test_do_handshake_alpn_client_server_mismatch();
+ // TODO: BoringSSL and OpenSSL have different behaviors on handling mismatched
+ // ALPN. Re-enable this test if we can detect in the runtime which SSL library
+ // is used.
+ // ssl_tsi_test_do_handshake_alpn_client_server_mismatch();
ssl_tsi_test_do_handshake_alpn_client_server_ok();
ssl_tsi_test_do_round_trip_for_all_configs();
ssl_tsi_test_do_round_trip_odd_buffer_size();
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index 28887f8128..2edd10898c 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -706,7 +706,6 @@ TEST_P(End2endTest, ReconnectChannel) {
if (GetParam().inproc) {
return;
}
- gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "200");
int poller_slowdown_factor = 1;
// It needs 2 pollset_works to reconnect the channel with polling engine
// "poll"
@@ -1828,6 +1827,7 @@ INSTANTIATE_TEST_CASE_P(ResourceQuotaEnd2end, ResourceQuotaEnd2endTest,
} // namespace grpc
int main(int argc, char** argv) {
+ gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "200");
grpc_test_init(argc, argv);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();