|
2 | 2 | import os
|
3 | 3 | from typing import List
|
4 | 4 |
|
| 5 | +from ldclient.impl.util import log |
| 6 | + |
5 | 7 | import pytest
|
6 | 8 | import tempfile
|
7 | 9 | import threading
|
@@ -117,8 +119,11 @@ def make_temp_file(content):
|
117 | 119 | return path
|
118 | 120 |
|
119 | 121 | def replace_file(path, content):
|
| 122 | + log.error('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ making a new temp file') |
120 | 123 | temp_path = make_temp_file(content)
|
| 124 | + log.error('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ renaming temp file from %s to %s' % (temp_path, path)) |
121 | 125 | os.rename(temp_path, path)
|
| 126 | + log.error('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ done') |
122 | 127 |
|
123 | 128 | def test_does_not_load_data_prior_to_start():
|
124 | 129 | path = make_temp_file('{"flagValues":{"key":"value"}}')
|
@@ -235,13 +240,17 @@ def test_does_not_reload_modified_file_if_auto_update_is_off():
|
235 | 240 | os.remove(path)
|
236 | 241 |
|
237 | 242 | def do_auto_update_test(options):
|
| 243 | + log.error('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ preparing to make flag file') |
238 | 244 | path = make_temp_file(flag_only_json)
|
| 245 | + log.error('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ flag file made with path %s' % path) |
239 | 246 | options['paths'] = path
|
240 | 247 | try:
|
241 | 248 | source = make_data_source(Config("SDK_KEY"), **options)
|
| 249 | + log.error('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ starting the data source') |
242 | 250 | source.start()
|
243 | 251 | assert len(store.all(SEGMENTS, lambda x: x)) == 0
|
244 | 252 | time.sleep(0.5)
|
| 253 | + log.error('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ replacing the file') |
245 | 254 | replace_file(path, segment_only_json)
|
246 | 255 | deadline = time.time() + 20
|
247 | 256 | while time.time() < deadline:
|
|
0 commit comments