Skip to content

Commit 5f3cb5c

Browse files
committed
timing fix
1 parent 746820a commit 5f3cb5c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

configcatclienttests/test_autopollingcachepolicy.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,14 @@ def test_callback(self):
142142
max_init_wait_time_seconds=5),
143143
hooks, config_fetcher, log, config_cache, False)
144144
time.sleep(1)
145+
wait_tolerance = 0.3
145146
self.assertEqual(config_fetcher.get_call_count, 1)
146147
self.assertEqual(hook_callbacks.changed_config_call_count, 1)
147-
time.sleep(1.2)
148+
time.sleep(1 + wait_tolerance)
148149
self.assertEqual(config_fetcher.get_call_count, 2)
149150
self.assertEqual(hook_callbacks.changed_config_call_count, 1)
150151
config_fetcher.set_configuration_json(TEST_JSON2)
151-
time.sleep(2.2)
152+
time.sleep(2 + wait_tolerance)
152153
self.assertEqual(config_fetcher.get_call_count, 3)
153154
self.assertEqual(hook_callbacks.changed_config_call_count, 2)
154155
cache_policy.close()

0 commit comments

Comments
 (0)