Skip to content

Commit

Permalink
Make ChannelCredsRegistryTest order independent (grpc#29644)
Browse files Browse the repository at this point in the history
  • Loading branch information
yousukseung authored and lidizheng committed May 24, 2022
1 parent 8d862a1 commit ab4ac65
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/core/security/channel_creds_registry_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@ class TestChannelCredsFactory : public ChannelCredsFactory<> {
}
};

TEST(ChannelCredsRegistry2Test, DefaultCreds) {
class ChannelCredsRegistryTest : public ::testing::Test {
protected:
void SetUp() override {
CoreConfiguration::Reset();
grpc_init();
}
};

TEST_F(ChannelCredsRegistryTest, DefaultCreds) {
// Default creds.
EXPECT_TRUE(CoreConfiguration::Get().channel_creds_registry().IsSupported(
"google_default"));
Expand All @@ -63,10 +71,7 @@ TEST(ChannelCredsRegistry2Test, DefaultCreds) {
nullptr);
}

TEST(ChannelCredsRegistry2Test, Register) {
CoreConfiguration::Reset();
grpc_init();

TEST_F(ChannelCredsRegistryTest, Register) {
// Before registration.
EXPECT_FALSE(
CoreConfiguration::Get().channel_creds_registry().IsSupported("test"));
Expand Down

0 comments on commit ab4ac65

Please sign in to comment.