Make projection cycle planning scale-safe
This commit is contained in:
parent
f1fabaf0ca
commit
5b43c44dd7
2 changed files with 52 additions and 32 deletions
|
|
@ -14,6 +14,7 @@ from unittest import mock
|
|||
|
||||
from docforge.errors import DocForgeError
|
||||
from docforge.manual_projection import (
|
||||
_cycles,
|
||||
build_manual_projection_package,
|
||||
build_manual_render_plan,
|
||||
)
|
||||
|
|
@ -390,6 +391,21 @@ class ProjectionContractTests(unittest.TestCase):
|
|||
workflow["cross_references"],
|
||||
)
|
||||
|
||||
def test_cycle_detection_handles_the_maximum_deep_graph_iteratively(self) -> None:
|
||||
node_ids = tuple(f"node.{index:05d}" for index in range(10_000))
|
||||
chain = tuple(
|
||||
Edge(node_ids[index], "depends_on", node_ids[index + 1])
|
||||
for index in range(len(node_ids) - 1)
|
||||
)
|
||||
self.assertEqual([], _cycles(node_ids, chain))
|
||||
self.assertEqual(
|
||||
[list(node_ids)],
|
||||
_cycles(
|
||||
node_ids,
|
||||
(*chain, Edge(node_ids[-1], "depends_on", node_ids[0])),
|
||||
),
|
||||
)
|
||||
|
||||
def test_alpha_compatibility_shim_preserves_legacy_identity_and_bytes(self) -> None:
|
||||
renderer = GenericHtmlRenderer()
|
||||
self.assertEqual(ALPHA_RENDERER_VERSION, renderer.renderer_version)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue