mirror of
https://github.com/l5yth/potato-mesh.git
synced 2026-08-07 17:33:26 +02:00
data: fix position time updates (#715)
* data: fix position time updates * data: fix position time updates
This commit is contained in:
@@ -36,9 +36,15 @@ from data.mesh_ingestor.queue import (
|
||||
_enqueue_post_json,
|
||||
_post_json,
|
||||
_queue_post_json,
|
||||
_CHANNEL_POST_PRIORITY,
|
||||
_DEFAULT_POST_PRIORITY,
|
||||
_INGESTOR_POST_PRIORITY,
|
||||
_MESSAGE_POST_PRIORITY,
|
||||
_NEIGHBOR_POST_PRIORITY,
|
||||
_NODE_POST_PRIORITY,
|
||||
_POSITION_POST_PRIORITY,
|
||||
_TELEMETRY_POST_PRIORITY,
|
||||
_TRACE_POST_PRIORITY,
|
||||
)
|
||||
|
||||
|
||||
@@ -47,6 +53,29 @@ def _fresh_state() -> QueueState:
|
||||
return QueueState()
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Priority constant ordering
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def test_priority_constants_ordering():
|
||||
"""Verify the intended priority hierarchy: ingestor first, telemetry last.
|
||||
|
||||
Lower numeric values are dequeued first (min-heap semantics). The ordering
|
||||
must be: ingestor < channel < node < message < neighbor < trace < position
|
||||
< telemetry < default. Any regression in this order means the web backend
|
||||
may assign the wrong protocol to nodes and messages on startup.
|
||||
"""
|
||||
assert _INGESTOR_POST_PRIORITY < _CHANNEL_POST_PRIORITY
|
||||
assert _CHANNEL_POST_PRIORITY < _NODE_POST_PRIORITY
|
||||
assert _NODE_POST_PRIORITY < _MESSAGE_POST_PRIORITY
|
||||
assert _MESSAGE_POST_PRIORITY < _NEIGHBOR_POST_PRIORITY
|
||||
assert _NEIGHBOR_POST_PRIORITY < _TRACE_POST_PRIORITY
|
||||
assert _TRACE_POST_PRIORITY < _POSITION_POST_PRIORITY
|
||||
assert _POSITION_POST_PRIORITY < _TELEMETRY_POST_PRIORITY
|
||||
assert _TELEMETRY_POST_PRIORITY < _DEFAULT_POST_PRIORITY
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# _post_json
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user