diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 37d9c09..e6a0e32 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -39,13 +39,6 @@ jobs: os: macos-latest - python-version: "3.7" os: macos-latest - include: # So run those legacy versions on Intel CPUs. - - python-version: "3.5" - os: macos-13 - - python-version: "3.6" - os: macos-13 - - python-version: "3.7" - os: macos-13 steps: - uses: actions/checkout@v5 diff --git a/configcatclienttests/test_autopollingcachepolicy.py b/configcatclienttests/test_autopollingcachepolicy.py index b6e0553..d8f921a 100644 --- a/configcatclienttests/test_autopollingcachepolicy.py +++ b/configcatclienttests/test_autopollingcachepolicy.py @@ -59,7 +59,8 @@ def test_init_wait_time_timeout(self): end_time = time.time() elapsed_time = end_time - start_time self.assertEqual(config, None) - self.assertGreaterEqual(elapsed_time, 1) + wait_tolerance = 0.1 + self.assertGreaterEqual(elapsed_time, 1 - wait_tolerance) self.assertLess(elapsed_time, 2) cache_policy.close() @@ -69,7 +70,7 @@ def test_fetch_call_count(self): cache_policy = ConfigService('', PollingMode.auto_poll(poll_interval_seconds=2, max_init_wait_time_seconds=1), Hooks(), config_fetcher, log, config_cache, False) - wait_tolerance = 0.1 + wait_tolerance = 0.3 time.sleep(3 + wait_tolerance) self.assertEqual(config_fetcher.get_call_count, 2) config, _ = cache_policy.get_config() @@ -126,7 +127,8 @@ def test_rerun(self): cache_policy = ConfigService('', PollingMode.auto_poll(poll_interval_seconds=2, max_init_wait_time_seconds=5), Hooks(), config_fetcher, log, config_cache, False) - time.sleep(2.200) + wait_tolerance = 0.4 + time.sleep(2 + wait_tolerance) self.assertEqual(config_fetcher.get_call_count, 2) cache_policy.close() @@ -141,13 +143,14 @@ def test_callback(self): max_init_wait_time_seconds=5), hooks, config_fetcher, log, config_cache, False) time.sleep(1) + wait_tolerance = 0.3 self.assertEqual(config_fetcher.get_call_count, 1) self.assertEqual(hook_callbacks.changed_config_call_count, 1) - time.sleep(1.2) + time.sleep(1 + wait_tolerance) self.assertEqual(config_fetcher.get_call_count, 2) self.assertEqual(hook_callbacks.changed_config_call_count, 1) config_fetcher.set_configuration_json(TEST_JSON2) - time.sleep(2.2) + time.sleep(2 + wait_tolerance) self.assertEqual(config_fetcher.get_call_count, 3) self.assertEqual(hook_callbacks.changed_config_call_count, 2) cache_policy.close() @@ -162,14 +165,15 @@ def test_callback_exception(self): cache_policy = ConfigService('', PollingMode.auto_poll(poll_interval_seconds=2, max_init_wait_time_seconds=5), hooks, config_fetcher, log, config_cache, False) + wait_tolerance = 0.4 time.sleep(1) self.assertEqual(config_fetcher.get_call_count, 1) self.assertEqual(hook_callbacks.callback_exception_call_count, 1) - time.sleep(1.2) + time.sleep(1 + wait_tolerance) self.assertEqual(config_fetcher.get_call_count, 2) self.assertEqual(hook_callbacks.callback_exception_call_count, 1) config_fetcher.set_configuration_json(TEST_JSON2) - time.sleep(2.2) + time.sleep(2 + wait_tolerance) self.assertEqual(config_fetcher.get_call_count, 3) self.assertEqual(hook_callbacks.callback_exception_call_count, 2) cache_policy.close() @@ -232,7 +236,8 @@ def test_return_cached_config_when_cache_is_not_expired(self): self.assertEqual(config_fetcher.get_call_count, 0) self.assertEqual(config_fetcher.get_fetch_count, 0) - time.sleep(3) + wait_tolerance = 0.1 + time.sleep(3 + wait_tolerance) config, _ = cache_policy.get_config() settings = config.get(FEATURE_FLAGS)