Give `test_custom_answer_reaches_model_through_inline_picker` the 10 s hang guard its sibling tests use, fixing a CI flake

Closed
DS
1mo ago
+1-1

This pull request was posted by Claude Code using claude-opus-5-5 on behalf of David.

tests/clai2/test_ask_user_menu.py::test_custom_answer_reaches_model_through_inline_picker[\r] failed its 5 s anyio.fail_after (5.47 s) in merge-queue run 41554918326, which removed #12252, a SKILL.md-only PR, from the queue.

The guard wraps the whole Agent.run, and the run hadn't hung. The traceback shows the run task had already finished with AgentRunResult(output='done') when the deadline cancelled the wait. The runner was slow: in the same job, test_declining_reaches_the_model_through_the_plugin, an agent run with no terminal at all, took 3.64 s. The picker can't miss a key: PromptKeys.start() reads the whole pipe before the menu worker starts, and the worker polls a Queue.

The guard now allows 10 s, the same as the file's other two hang guards. The assertions are unchanged.

Verification

  • tests/clai2/test_ask_user_menu.py passes locally, run serially.
  • The [\r] node passed 5 of 5 serial runs.

New public surface

None.

What changes for existing users

Nothing; this only changes a test.

PR decisions

2026-11-03 · widen the hang guard to 10 s, not restructure the test · iter -

  • Decision: Raise the test's anyio.fail_after from 5 to 10, the deadline this file's other two hang guards use; assertions unchanged
  • Why: The guard wraps the whole Agent.run; the failing run had already completed (task result AgentRunResult(output='done')) at 5.47 s, and test_declining_reaches_the_model_through_the_plugin, an agent run with no terminal, took 3.64 s in the same job. Keys are queued before the picker reads them, so no wakeup can be missed
  • Source: https://github.com/pydantic/pydantic-ai/actions/runs/41554918326/job/125651475493
  • Session: 83631298-f18b-4f97-bb7b-06200e7dbe70

2026-11-03 · no known-flakes entry for the widened guard · iter -

2026-11-03 · pre-push review 1 of 3 at a110b33e5742905880ea54ff990455d4b351b6d0 · iter -

2026-11-03 · pre-push review 1 of 3 at a110b33e5742905880ea54ff990455d4b351b6d0 · iter -

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
  • PR title is fit for the release changelog.

Summary by cubic

Fixes the CI flake in test_custom_answer_reaches_model_through_inline_picker by widening its hang guard from 5 s to 10 s.

The old 5 s guard wrapped the whole Agent.run, and a loaded runner took just over 5 s to finish a run that had already completed, failing the test. The new 10 s limit matches the hang guard the file's other two tests use; assertions are unchanged.