Skip to content

Commit e80aa16

Browse files
committed
Revert "tests: fix intermittent failure"
This reverts commit 5a39141.
1 parent daafa4b commit e80aa16

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

optimizely/config_manager.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ def _run(self):
299299
try:
300300
while self.is_running:
301301
self.fetch_datafile()
302-
self.logger.debug("This thread is running")
303302
time.sleep(self.update_interval)
304303
except (OSError, OverflowError) as err:
305304
self.logger.error('Error in time.sleep. '

tests/test_config_manager.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import json
1515
import mock
1616
import requests
17-
from six.moves import queue
1817

1918
from optimizely import config_manager
2019
from optimizely import exceptions as optimizely_exceptions
@@ -279,15 +278,7 @@ def test_fetch_datafile(self, _):
279278

280279
def test_is_running(self, _):
281280
""" Test that polling thread is running after instance of PollingConfigManager is created. """
282-
blocking_queue = queue.Queue()
283-
with mock.patch('optimizely.config_manager.PollingConfigManager.fetch_datafile',
284-
side_effect=lambda: blocking_queue.put_nowait('fetch_datafile called')) as mock_fetch_datafile:
285-
project_config_manager = config_manager.PollingConfigManager(
286-
sdk_key='some_key', update_interval=1)
287-
288-
self.assertTrue(project_config_manager.is_running)
289-
# Wait for 5 seconds before asserting mock
290-
try:
291-
blocking_queue.get(True, 5)
292-
except queue.Empty:
293-
mock_fetch_datafile.assert_called_with()
281+
with mock.patch('optimizely.config_manager.PollingConfigManager.fetch_datafile') as mock_fetch_datafile:
282+
project_config_manager = config_manager.PollingConfigManager(sdk_key='some_key')
283+
self.assertTrue(project_config_manager.is_running)
284+
mock_fetch_datafile.assert_called_with()

0 commit comments

Comments
 (0)