Skip to content

Commit 0f5e3a2

Browse files
committed
polishing
1 parent f538ee8 commit 0f5e3a2

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

splitio/sync/synchronizer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ def sync_all(self, max_retry_attempts=_SYNC_ALL_NO_RETRIES):
320320
break
321321
how_long = self._backoff.get()
322322
time.sleep(how_long)
323-
continue
324323

325324
_LOGGER.error("Could not correctly synchronize splits and segments after %d attempts.", retry_attempts)
326325

tests/client/test_factory.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_redis_client_creation(self, mocker):
142142

143143
def test_uwsgi_forked_client_creation(self):
144144
"""Test client with preforked initialization."""
145-
# pytest.set_trace()
145+
# Invalid API Key with preforked should exit after 3 attempts.
146146
factory = get_factory('some_api_key', config={'preforkedInitialization': True})
147147
assert isinstance(factory._storages['splits'], inmemmory.InMemorySplitStorage)
148148
assert isinstance(factory._storages['segments'], inmemmory.InMemorySegmentStorage)
@@ -228,9 +228,10 @@ def _split_synchronizer(self, ready_flag, some, auth_api, streaming_enabled, sdk
228228
mocker.patch('splitio.sync.manager.Manager.__init__', new=_split_synchronizer)
229229

230230
# Start factory and make assertions
231+
# Using invalid key should result in a timeout exception
231232
factory = get_factory('some_api_key')
232233
try:
233-
factory.block_until_ready(1)
234+
factory.block_until_ready(1)
234235
except:
235236
pass
236237
assert factory.ready is False
@@ -316,7 +317,7 @@ def _split_synchronizer(self, ready_flag, some, auth_api, streaming_enabled, sdk
316317
# Start factory and make assertions
317318
factory = get_factory('some_api_key')
318319
try:
319-
factory.block_until_ready(1)
320+
factory.block_until_ready(1)
320321
except:
321322
pass
322323
assert factory.ready is False

tests/sync/test_synchronizer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def run(x, c):
3434

3535
sychronizer.synchronize_splits(None) # APIExceptions are handled locally and should not be propagated!
3636

37+
# test forcing to have only one retry attempt and then exit
3738
sychronizer.sync_all(1) # sync_all should not throw!
3839

3940
def test_sync_all_failed_segments(self, mocker):

0 commit comments

Comments
 (0)