From 6cdc9890b5f83ff731a6363a785272bd1a75f87e Mon Sep 17 00:00:00 2001 From: Janusz Sobczak Date: Fri, 14 Apr 2023 10:43:44 -0700 Subject: [PATCH] Enable cancellation flag support by default PiperOrigin-RevId: 524329836 --- internal/platform/feature_flags.h | 2 +- internal/platform/feature_flags_test.cc | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/platform/feature_flags.h b/internal/platform/feature_flags.h index 9aae0f39..8ff66d12 100644 --- a/internal/platform/feature_flags.h +++ b/internal/platform/feature_flags.h @@ -26,7 +26,7 @@ class FeatureFlags { public: // Holds for all the feature flags. struct Flags { - bool enable_cancellation_flag = false; + bool enable_cancellation_flag = true; bool enable_async_bandwidth_upgrade = true; // If a scheduled runnable is already running, Cancel() will synchronously // wait for the task to complete. diff --git a/internal/platform/feature_flags_test.cc b/internal/platform/feature_flags_test.cc index 3d4925ef..e6e4eedd 100644 --- a/internal/platform/feature_flags_test.cc +++ b/internal/platform/feature_flags_test.cc @@ -21,23 +21,23 @@ namespace nearby { namespace { constexpr FeatureFlags::Flags kTestFeatureFlags{ - .enable_cancellation_flag = true, + .enable_cancellation_flag = false, .keep_alive_interval_millis = 5000, .keep_alive_timeout_millis = 30000}; TEST(FeatureFlagsTest, ToSetFeatureWorks) { const FeatureFlags& features = FeatureFlags::GetInstance(); - EXPECT_FALSE(features.GetFlags().enable_cancellation_flag); + EXPECT_TRUE(features.GetFlags().enable_cancellation_flag); EXPECT_EQ(5000, features.GetFlags().keep_alive_interval_millis); EXPECT_EQ(30000, features.GetFlags().keep_alive_timeout_millis); MediumEnvironment& medium_environment = MediumEnvironment::Instance(); medium_environment.SetFeatureFlags(kTestFeatureFlags); - EXPECT_TRUE(features.GetFlags().enable_cancellation_flag); + EXPECT_FALSE(features.GetFlags().enable_cancellation_flag); const FeatureFlags& another_features_ref = FeatureFlags::GetInstance(); - EXPECT_TRUE(another_features_ref.GetFlags().enable_cancellation_flag); + EXPECT_FALSE(another_features_ref.GetFlags().enable_cancellation_flag); } } // namespace