From 7665500f9938f5c2900830e4121ac050819f1f84 Mon Sep 17 00:00:00 2001 From: Piotr Pauksztelo Date: Thu, 5 Dec 2024 09:20:52 +0100 Subject: [PATCH] Add comments to generic resolver tests with cache metrics --- .../processor/generic_resolver/test_generic_resolver.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit/processor/generic_resolver/test_generic_resolver.py b/tests/unit/processor/generic_resolver/test_generic_resolver.py index 2d6eec123..09e5d2e6e 100644 --- a/tests/unit/processor/generic_resolver/test_generic_resolver.py +++ b/tests/unit/processor/generic_resolver/test_generic_resolver.py @@ -488,6 +488,8 @@ def test_resolve_generic_and_multiple_match_first_only(self): assert document == expected def test_resolve_from_cache_with_large_enough_cache(self): + """The metrics are mocked and their values are the sum of previously added cache values, + instead of being the current cache values.""" config = deepcopy(self.CONFIG) config["max_cache_entries"] = 10 self.object = Factory.create({"generic_resolver": config}) @@ -526,6 +528,8 @@ def test_resolve_from_cache_with_large_enough_cache(self): assert self.object.metrics.num_cache_entries == 4 def test_resolve_from_cache_with_cache_smaller_than_results(self): + """The metrics are mocked and their values are the sum of previously added cache values, + instead of being the current cache values.""" config = deepcopy(self.CONFIG) config["max_cache_entries"] = 1 self.object = Factory.create({"generic_resolver": config}) @@ -602,6 +606,8 @@ def test_resolve_without_cache(self): assert self.object.metrics.num_cache_entries == 0 def test_resolve_from_cache_with_update_interval_2(self): + """The metrics are mocked and their values are the sum of previously added cache values, + instead of being the current cache values.""" config = deepcopy(self.CONFIG) config["cache_metrics_interval"] = 2 config["max_cache_entries"] = 10