test(backend): reuse workflow selector discovery#9731
Conversation
|
Thanks for this refactor, @tianmind-studio — clean approach. What I checked
Checks Verdict by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Reviewed — looks good; not auto-merging (over scope/size or non-bug area), landing left to maintainer.
kodjima33
left a comment
There was a problem hiding this comment.
test(backend): reuse workflow selector discovery; CI green
kodjima33
left a comment
There was a problem hiding this comment.
test(backend): reuse workflow selector discovery; CI green
What changed and why
Reuse one module-scoped workflow-selector discovery across the contract tests instead of reloading the selector and rescanning every backend unit test in each test. This keeps the Windows fast-unit lane below its per-file timing budget without changing the contract assertions. Closes #9729.
Product invariants affected
none
How it was verified
backend/test.shrun five times after the change. All 19 tests passed each time, with total runs of 0.57s, 0.47s, 0.54s, 0.52s, and 0.60s and no duration warning.black --check --line-length 120 --skip-string-normalization backend/tests/unit/test_workflow_contracts.pyorigin/mainworktree, so that baseline is unrelated to this test-only diff.Tests
The changed file is the regression coverage. Its existing 19 contract tests still exercise the same assertion set, now under the same strict fast-unit timing guard that exposed the Windows failure.
Root cause and durable guard (bug fixes)
Each of seven tests independently imported
select_backend_unit_tests.pyand walked the complete unit-test tree. Windows filesystem startup variance pushed that repeated discovery over the fast-unit per-file budget even though every assertion passed. A module-scoped fixture performs the immutable discovery once, and the existing duration guard continues to enforce the budget.