Rename planner and document rewrite: rewrite_documents moves qualified names of the renamed flow in every flow (ports, inputs, outputs) and dashboard binding (one key table, WIDGET_BINDINGS, shared with the WidgetDef accessors, legacy pages included), published and draft, as plain JSON with both variants above either version; plan_rename reports documents, counts, fingerprint, warnings and refusals; superuser plan routes for flows and dashboards; key residue classifies state as the mapper does; duplicate retargets inputs and outputs too; queue reports its Redis version and other consumers
This commit is contained in:
@@ -4,6 +4,7 @@ FLUKSIO_TEST_REDIS_HOST (and optional PORT)."""
|
||||
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
@@ -487,3 +488,19 @@ def test_state_is_never_moved_onto_a_key_that_exists(state):
|
||||
with pytest.raises(RuntimeError, match="exists"):
|
||||
state.rename_keys(HEAT)
|
||||
assert state.get("warm.temp") == 2
|
||||
|
||||
|
||||
def test_another_engine_reading_the_queue_is_seen(redis_queue):
|
||||
assert redis_queue.server_version() >= (7, 0)
|
||||
redis_queue.claim(1, 10)
|
||||
assert redis_queue.other_consumers(10_000) == []
|
||||
|
||||
other = _redis_queue(redis_queue._ns, "engine-b")
|
||||
try:
|
||||
other.claim(1, 10)
|
||||
assert redis_queue.other_consumers(10_000) == ["engine-b"]
|
||||
# Gone quiet for longer than asked about: a stopped engine.
|
||||
time.sleep(0.05)
|
||||
assert redis_queue.other_consumers(10) == []
|
||||
finally:
|
||||
other.close()
|
||||
|
||||
Reference in New Issue
Block a user