Skip to content

Commit 644cc13

Browse files
committed
temp debugging
1 parent 2ca4af0 commit 644cc13

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PYTEST_FLAGS=-W error::SyntaxWarning
1+
PYTEST_FLAGS=-W error::SyntaxWarning -s
22

33
TEMP_TEST_OUTPUT=/tmp/contract-test-service.log
44

@@ -28,12 +28,12 @@ install:
2828
.PHONY: test
2929
test: #! Run unit tests
3030
test: install
31-
@LD_SKIP_DATABASE_TESTS=1 poetry run pytest $(PYTEST_FLAGS)
31+
@LD_SKIP_DATABASE_TESTS=1 poetry run pytest $(PYTEST_FLAGS) ldclient/testing/impl/datasystem/test_fdv2_datasystem.py::test_two_phase_init
3232

3333
.PHONY: test-all
3434
test-all: #! Run unit tests (including database integrations)
3535
test-all: install
36-
@poetry run pytest $(PYTEST_FLAGS)
36+
@poetry run pytest $(PYTEST_FLAGS) ldclient/testing/impl/datasystem/test_fdv2_datasystem.py::test_two_phase_init
3737

3838
.PHONY: lint
3939
lint: #! Run type analysis and linting checks

ldclient/impl/datasystem/fdv2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ def _run_initializers(self, set_on_ready: Event):
307307
log.info("Attempting to initialize via %s", initializer.name)
308308

309309
basis_result = initializer.fetch(self._store)
310+
print("@@@@@@", "init", basis_result, "\n")
310311

311312
if isinstance(basis_result, _Fail):
312313
log.warning("Initializer %s failed: %s", initializer.name, basis_result.error)
@@ -446,6 +447,7 @@ def _consume_synchronizer_results(
446447
def reader(self: 'FDv2'):
447448
try:
448449
for update in synchronizer.sync(self._store):
450+
print("@@@@@@", "update is at", update, "\n")
449451
action_queue.put(update)
450452
finally:
451453
action_queue.put("quit")

ldclient/testing/impl/datasystem/test_fdv2_datasystem.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ def listener(flag_change: FlagChange):
3636
count += 1
3737
changes.append(flag_change)
3838

39-
if count == 2:
39+
if count >= 2:
4040
changed.set()
4141

4242
fdv2.flag_tracker.add_listener(listener)
4343

4444
fdv2.start(set_on_ready)
4545
assert set_on_ready.wait(1), "Data system did not become ready in time"
46+
changed.clear()
4647

4748
td_synchronizer.update(td_synchronizer.flag("feature-flag").on(False))
4849
assert changed.wait(1), "Flag change listener was not called in time"

0 commit comments

Comments
 (0)