Fix work recovery and reduce engine and chart overhead
Docs / docs (push) Successful in 33s
Playwright Tests / test-playwright (1, 2) (push) Failing after 1m37s
Playwright Tests / test-playwright (2, 2) (push) Failing after 27s
pre-commit / pre-commit (push) Failing after 2m37s
Test Backend / test-backend (3.12) (push) Successful in 5m7s
Test Backend / test-backend (3.14) (push) Successful in 5m2s
Compose Smoke Test / test-compose (push) Failing after 28s
Playwright Tests / merge-reports (push) Failing after 2m29s
Docs / docs (push) Successful in 33s
Playwright Tests / test-playwright (1, 2) (push) Failing after 1m37s
Playwright Tests / test-playwright (2, 2) (push) Failing after 27s
pre-commit / pre-commit (push) Failing after 2m37s
Test Backend / test-backend (3.12) (push) Successful in 5m7s
Test Backend / test-backend (3.14) (push) Successful in 5m2s
Compose Smoke Test / test-compose (push) Failing after 28s
Playwright Tests / merge-reports (push) Failing after 2m29s
This commit is contained in:
@@ -122,3 +122,24 @@ def test_a_hop_costs_a_bounded_number_of_state_operations() -> None:
|
||||
|
||||
total = sum(state.calls[name] for name in COUNTED)
|
||||
assert total <= 8, f"state operations per hop grew: {dict(state.calls)}"
|
||||
|
||||
|
||||
def test_reading_one_value_does_not_list_or_read_other_messages(monkeypatch) -> None:
|
||||
state = MemoryState()
|
||||
state.update({f"f.m{i}": i for i in range(1000)})
|
||||
state.update({"f.m0": None, "__ts__:f.m0": 123.0})
|
||||
pipeline = Pipeline([], state=state)
|
||||
reads = []
|
||||
get_multi = state.get_multi
|
||||
|
||||
def read(keys):
|
||||
reads.append(keys)
|
||||
return get_multi(keys)
|
||||
|
||||
def no_listing():
|
||||
raise AssertionError("A single-message read must not enumerate state")
|
||||
|
||||
monkeypatch.setattr(MemoryState, "get_multi", lambda self, keys: read(keys))
|
||||
monkeypatch.setattr(MemoryState, "message_names", lambda self: no_listing())
|
||||
assert pipeline.value("f.m0") == {"value": None, "ts": 123.0}
|
||||
assert reads == [["f.m0", "__ts__:f.m0"]]
|
||||
|
||||
Reference in New Issue
Block a user