Skip to content

Stabilize plugin MCP fixture tests#19452

Merged
dylan-hurd-oai merged 2 commits intomainfrom
codex/fix-main-plugin-test-fixtures
Apr 28, 2026
Merged

Stabilize plugin MCP fixture tests#19452
dylan-hurd-oai merged 2 commits intomainfrom
codex/fix-main-plugin-test-fixtures

Conversation

@dylan-hurd-oai
Copy link
Copy Markdown
Collaborator

@dylan-hurd-oai dylan-hurd-oai commented Apr 24, 2026

Why

Recent main CI had repeated flakes in the plugin fixture tests:

The failures were in the same plugin/MCP fixture family: assertions expected sample plugin guidance or tool inventory, but the test could observe the session before the sample MCP server had finished startup.

Root Cause

explicit_plugin_mentions_inject_plugin_guidance submitted the user turn immediately after constructing the session. MCP startup is asynchronous, so on a slower or busier CI runner the prompt could be built before the sample plugin MCP server had reported its tools. That made the test depend on scheduler timing rather than the fixture being ready.

plugin_mcp_tools_are_listed already needed the same readiness condition, but its wait logic was local to that test.

What Changed

  • Added a shared wait_for_sample_mcp_ready helper for the plugin fixture tests.
  • Wait for McpStartupComplete before submitting the explicit plugin mention turn.
  • Reuse the same readiness helper in the MCP tool-listing test.

Why This Should Be Reliable

The tests now wait for the explicit readiness signal from the sample MCP server before asserting guidance or tools derived from that server. This removes the startup race while still exercising the real fixture path, so the assertions should only run after the plugin inventory is deterministic.

Verification

  • cargo test -p codex-core --test all plugins::
  • GitHub CI for this PR is passing.

@dylan-hurd-oai dylan-hurd-oai requested a review from a team as a code owner April 24, 2026 21:59
@dylan-hurd-oai dylan-hurd-oai enabled auto-merge (squash) April 28, 2026 00:55
@dylan-hurd-oai dylan-hurd-oai merged commit 7e8594f into main Apr 28, 2026
25 checks passed
@dylan-hurd-oai dylan-hurd-oai deleted the codex/fix-main-plugin-test-fixtures branch April 28, 2026 01:14
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants