aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/security
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2018-10-26 12:34:08 -0700
committerGravatar yang-g <yangg@google.com>2018-10-26 14:04:36 -0700
commit83d74bf6fcea715f9e36ae992ab59d16f2f2d29b (patch)
tree9b2018b0859900927d844781c9089e2ee2431568 /test/core/security
parentef053d87ce2033c84c7bbb217eab74c19363e7b6 (diff)
Remove the internal cache for google_default_credentials
Diffstat (limited to 'test/core/security')
-rw-r--r--test/core/security/credentials_test.cc12
1 files changed, 2 insertions, 10 deletions
diff --git a/test/core/security/credentials_test.cc b/test/core/security/credentials_test.cc
index 97156761bd..6d1321d6b7 100644
--- a/test/core/security/credentials_test.cc
+++ b/test/core/security/credentials_test.cc
@@ -954,17 +954,9 @@ static void test_google_default_creds_gce(void) {
run_request_metadata_test(creds->call_creds, auth_md_ctx, state);
grpc_core::ExecCtx::Get()->Flush();
- /* Check that we get a cached creds if we call
- grpc_google_default_credentials_create again.
- GCE detection should not occur anymore either. */
- g_test_gce_tenancy_checker_called = false;
- grpc_channel_credentials* cached_creds =
- grpc_google_default_credentials_create();
- GPR_ASSERT(cached_creds == &creds->base);
- GPR_ASSERT(g_test_gce_tenancy_checker_called == false);
+ GPR_ASSERT(g_test_gce_tenancy_checker_called == true);
/* Cleanup. */
- grpc_channel_credentials_unref(cached_creds);
grpc_channel_credentials_unref(&creds->base);
grpc_httpcli_set_override(nullptr, nullptr);
grpc_override_well_known_credentials_path_getter(nullptr);
@@ -983,7 +975,7 @@ static void test_no_google_default_creds(void) {
/* Simulate a successful detection of GCE. */
GPR_ASSERT(grpc_google_default_credentials_create() == nullptr);
- /* Try a cached one. GCE detection should not occur anymore. */
+ /* Try a second one. GCE detection should not occur anymore. */
g_test_gce_tenancy_checker_called = false;
GPR_ASSERT(grpc_google_default_credentials_create() == nullptr);
GPR_ASSERT(g_test_gce_tenancy_checker_called == false);