From 79dffb022fe3097ad05cdfaab17a0fb65b6ae5df Mon Sep 17 00:00:00 2001 From: segoon Date: Sat, 8 Jun 2024 00:03:38 +0300 Subject: [PATCH] feat backend-cpp: fastcgi2 wrapper for uservices 4c129d54a5227fe96b8f66b73b7d8f38179848e8 --- core/include/userver/cache/cache_config.hpp | 29 ++++++++++--------- .../userver/testsuite/cache_control.hpp | 13 +++++---- .../pytest_userver/plugins/dynamic_config.py | 6 +++- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/core/include/userver/cache/cache_config.hpp b/core/include/userver/cache/cache_config.hpp index 004328453dd9..27d5c70521cd 100644 --- a/core/include/userver/cache/cache_config.hpp +++ b/core/include/userver/cache/cache_config.hpp @@ -60,31 +60,32 @@ ConfigPatch Parse(const formats::json::Value& value, formats::parse::To); struct Config final { + Config() = default; explicit Config(const yaml_config::YamlConfig& config, const std::optional& dump_config); Config MergeWith(const ConfigPatch& patch) const; - AllowedUpdateTypes allowed_update_types; - bool allow_first_update_failure; + AllowedUpdateTypes allowed_update_types{}; + bool allow_first_update_failure{}; std::optional force_periodic_update; - bool config_updates_enabled; - bool has_pre_assign_check; + bool config_updates_enabled{}; + bool has_pre_assign_check{}; std::optional task_processor_name; - std::chrono::milliseconds cleanup_interval; - bool is_strong_period; + std::chrono::milliseconds cleanup_interval{}; + bool is_strong_period{}; std::optional failed_updates_before_expiration; - FirstUpdateMode first_update_mode; - FirstUpdateType first_update_type; + FirstUpdateMode first_update_mode{}; + FirstUpdateType first_update_type{}; - std::chrono::milliseconds update_interval; - std::chrono::milliseconds update_jitter; - std::chrono::milliseconds full_update_interval; - std::chrono::milliseconds full_update_jitter; + std::chrono::milliseconds update_interval{}; + std::chrono::milliseconds update_jitter{}; + std::chrono::milliseconds full_update_interval{}; + std::chrono::milliseconds full_update_jitter{}; std::optional exception_interval; - bool updates_enabled; - std::uint64_t alert_on_failing_to_update_times; + bool updates_enabled{}; + std::uint64_t alert_on_failing_to_update_times{}; }; extern const dynamic_config::Key> diff --git a/core/include/userver/testsuite/cache_control.hpp b/core/include/userver/testsuite/cache_control.hpp index 230acae742c0..9d5f81197ba0 100644 --- a/core/include/userver/testsuite/cache_control.hpp +++ b/core/include/userver/testsuite/cache_control.hpp @@ -100,18 +100,21 @@ class CacheControl final { template CacheResetRegistration RegisterCache(Component* self, std::string_view name, void (Component::*reset_method)()); - /// @endcond - private: - friend class CacheResetRegistration; struct CacheInfo final { std::string name; std::function reset; bool needs_span{true}; }; - struct CacheInfoNode; using CacheInfoIterator = CacheInfoNode*; + + // For internal use only. + CacheInfoIterator DoRegisterCache(CacheInfo&& info); + /// @endcond + private: + friend class CacheResetRegistration; + class CacheResetJob; void DoResetCaches( @@ -126,8 +129,6 @@ class CacheControl final { const std::unordered_set& force_incremental_names, const std::unordered_set* exclude_names); - CacheInfoIterator DoRegisterCache(CacheInfo&& info); - void UnregisterCache(CacheInfoIterator) noexcept; static void DoResetSingleCache( diff --git a/testsuite/pytest_plugins/pytest_userver/plugins/dynamic_config.py b/testsuite/pytest_plugins/pytest_userver/plugins/dynamic_config.py index 8d8d70eedfed..eeef0baf309e 100644 --- a/testsuite/pytest_plugins/pytest_userver/plugins/dynamic_config.py +++ b/testsuite/pytest_plugins/pytest_userver/plugins/dynamic_config.py @@ -544,7 +544,11 @@ def _mock_configs(request): @mockserver.json_handler('/configs-service/configs/status') def _mock_configs_status(_request): - return {'updated_at': dynamic_config_changelog.timestamp} + return { + 'updated_at': dynamic_config_changelog.timestamp.strftime( + '%Y-%m-%dT%H:%M:%SZ', + ), + } @pytest.fixture