Skip to content

test(workflows): replace the fixed wait in injection identity test - #20136

Merged
javenciu merged 1 commit into
mainfrom
test/wait-discipline-workflow-injection-identity
Oct 16, 2026
Merged

javenciu merged 1 commit into
mainfrom
test/wait-discipline-workflow-injection-identity

Conversation

@javenciu

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Take test/test_workflow_injection_identity.py to zero short fixed waits, so the wait-discipline ratchet no longer carries a baseline line for it.

test/test_workflow_injection_identity.py holds one short fixed wait that test/test_wait_discipline_ratchet.py counts against the baseline line 1 test_workflow_injection_identity.py: at :43, await asyncio.wait_for(bound.wait(), 2) in test_completion_rechecks_target_after_binding.

Why it matters

Fixed waits are the repo's flake source: a loaded runner turns a generous-looking timeout into a red that has nothing to do with the code under test. The ratchet keeps a baseline of such sites per file and lets a count only go down; this change takes one file to zero.

Not a goal

  • Any other file's baseline line, or a change to the ratchet itself.
  • Refactoring or reformatting the test; no new helpers.

What changed (motivation → approach → change)

The 2 s ceiling bets that the runner reaches the paused session binding within two seconds. bound is the event the test's paused asyncio.to_thread shim sets once bind_session_execution has run, so the test already holds the real signal.

The test now awaits that event with await_until from kiro_crew.testing.wait, under the helper's lost-run bound (half the test's timeout). A hang fails by name instead of by a 2 s guess.

  • :43 asyncio.wait_for(bound.wait(), 2) becomes await await_until(bound, what="the session binding finishing"), now at :44.
  • The import sits beside its neighbours in the file's first-party block.
  • The baseline line 1 test_workflow_injection_identity.py is deleted.

Backwards compatibility

Compatible: a test-only change; no production code, API or protocol changes.

Removes nothing: the test asserts what it asserted before. The fixed wait is replaced by a wait on the same event, and the baseline line that counted it is deleted.

Tests

  • Delete the baseline line with the file untouched: test/test_wait_discipline_ratchet.py 1 failed, 38 passed. The failure names test/test_workflow_injection_identity.py: 0 -> 1 at :43.
  • After the edit: the ratchet and test/test_workflow_injection_identity.py together, 45 passed on each of three runs at -n0. The file's own tests are 6 passed before and 6 passed after.
  • The replaced wait is awaited: the same two files pass with -W error::RuntimeWarning -W error::pytest.PytestUnraisableExceptionWarning, and a copy of the file with the await dropped fails under those flags. -W error::RuntimeWarning alone does not catch a dropped await: the warning is raised inside the coroutine finalizer, and pytest reports it as a warning.
  • The test patches asyncio.to_thread, so the file ran first in one process at -n0 with test/test_workflows_inject.py, test/test_workflows_private_outputs.py, test/test_taskrunner_atomic_persistence.py, test/test_taskrunner_execution_capture_async.py, test/test_unattended_slot_guardrails.py and test/test_wheel_apply.py: 141 passed.
  • black, isort and flake8 are clean on the touched file.

In short: the 2 s wait_for on bound is now await await_until(bound, ...). The ratchet fails without the baseline deletion (1 failed, 38 passed) and passes with it (45 passed alongside the file's six tests).

Manual verification

N/A — the tests above exercise the change, and nothing renders.

Related Issues

No issue exists; burn-down of the wait-discipline baseline (precedents #19928, #20014, #19527).

Pattern harvest

Not generalizable: one baseline line taken to zero; the ratchet already holds the rule for every file.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality (no new functionality; the ratchet is the test that moves)
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable): N/A, test-only
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

@javenciu
javenciu requested review from a team and KiroCrewCaptain as code owners October 14, 2026 05:23
@javenciu
javenciu requested a review from mbriones98 October 14, 2026 05:23
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 88615d2cdfa51f146e3f4597554cde08e3b13bd3 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision 88615d2cdfa51f146e3f4597554cde08e3b13bd3 ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 88615d2cdfa51f146e3f4597554cde08e3b13bd3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] 88615d2

Description read

[DESCRIPTION-READ] 8fdd36d28c643f85c657178e82594734f256a11144983091af1f6708d03a2fd0

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 88615d2cdfa51f146e3f4597554cde08e3b13bd3 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 88615d2

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 88615d2cdfa51f146e3f4597554cde08e3b13bd3: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 88615d2cdfa51f146e3f4597554cde08e3b13bd3 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 88615d2

Verdict parsed from the review's SHA-scoped output markers for commit 88615d2cdfa51f146e3f4597554cde08e3b13bd3.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 88615d2cdfa51f146e3f4597554cde08e3b13bd3: <one-sentence reason>

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 14, 2026
@javenciu

Copy link
Copy Markdown
Contributor Author

Closing and reopening so CI runs on hosted runners: same-repo runs from this account queue on the fleet label without a runner (details on #19683).

@javenciu javenciu closed this Oct 14, 2026
@javenciu javenciu reopened this Oct 14, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 14, 2026
test_completion_rechecks_target_after_binding waited for the paused
session binding with a 2 s asyncio.wait_for, which the wait-discipline
ratchet counts against test_workflow_injection_identity.py. Await the
event with kiro_crew.testing.wait.await_until, whose ceiling is a
lost-run bound that fails by name, and delete the file's baseline line.
@javenciu
javenciu force-pushed the test/wait-discipline-workflow-injection-identity branch from 7c79846 to 88615d2 Compare October 14, 2026 11:09
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 14, 2026
@javenciu

Copy link
Copy Markdown
Contributor Author

Closing and reopening so CI runs on hosted runners: same-repo runs from this account queue on the fleet label without a runner (details on #19683).

@javenciu javenciu closed this Oct 14, 2026
@javenciu javenciu reopened this Oct 14, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 14, 2026
@javenciu
javenciu enabled auto-merge (squash) October 16, 2026 01:17

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 auto-approve: test (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: test-only; replaces a fixed asyncio.wait_for timeout in test_workflow_injection_identity.py with await_until and drops the file from the wait-discipline baseline.

@javenciu
javenciu merged commit a6217ea into main Oct 16, 2026
162 of 225 checks passed
@javenciu
javenciu deleted the test/wait-discipline-workflow-injection-identity branch October 16, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants