core-agent-ide/codex-rs/app-server/tests/common
Ahmed Ibrahim f26ad3c92c
Fix fuzzy search notification buffering in app-server tests (#14955)
## What is flaky
`codex-rs/app-server/tests/suite/fuzzy_file_search.rs` intermittently
loses the expected `fuzzyFileSearch/sessionUpdated` and
`fuzzyFileSearch/sessionCompleted` notifications when multiple
fuzzy-search sessions are active and CI delivers notifications out of
order.

## Why it was flaky
The wait helpers were keyed only by JSON-RPC method name.

- `wait_for_session_updated` consumed the next
`fuzzyFileSearch/sessionUpdated` notification even when it belonged to a
different search session.
- `wait_for_session_completed` did the same for
`fuzzyFileSearch/sessionCompleted`.
- Once an unmatched notification was read, it was dropped permanently
instead of buffered.
- That meant a valid completion for the target search could arrive
slightly early, be consumed by the wrong waiter, and disappear before
the test started waiting for it.

The result depended on notification ordering and runner scheduling
instead of on the actual product behavior.

## How this PR fixes it
- Add a buffered notification reader in
`codex-rs/app-server/tests/common/mcp_process.rs`.
- Match fuzzy-search notifications on the identifying payload fields
instead of matching only on method name.
- Preserve unmatched notifications in the in-process queue so later
waiters can still consume them.
- Include pending notification methods in timeout failures to make
future diagnosis concrete.

## Why this fix fixes the flakiness
The test now behaves like a real consumer of an out-of-order event
stream: notifications for other sessions stay buffered until the correct
waiter asks for them. Reordering no longer loses the target event, so
the test result is determined by whether the server emitted the right
notifications, not by which one happened to be read first.

Co-authored-by: Ahmed Ibrahim <219906144+aibrahim-oai@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
2026-03-17 10:52:16 -07:00
..
analytics_server.rs Add plugin usage telemetry (#14531) 2026-03-12 19:22:30 -07:00
auth_fixtures.rs fix(app-server): for external auth, replace id_token with chatgpt_acc… (#11240) 2026-02-09 20:48:58 -08:00
BUILD.bazel feat: add support for building with Bazel (#8875) 2026-01-09 11:09:43 -08:00
Cargo.toml Remove test-support feature from codex-core and replace it with explicit test toggles (#11405) 2026-02-10 22:44:02 -08:00
config.rs Add openai_base_url config override for built-in provider (#12031) 2026-03-13 20:12:25 -06:00
lib.rs Add plugin usage telemetry (#14531) 2026-03-12 19:22:30 -07:00
mcp_process.rs Fix fuzzy search notification buffering in app-server tests (#14955) 2026-03-17 10:52:16 -07:00
mock_model_server.rs [chore] move app server tests from chat completion to responses (#8939) 2026-01-08 22:27:55 +00:00
models_cache.rs Apply argument comment lint across codex-rs (#14652) 2026-03-16 16:48:15 -07:00
responses.rs Add request permissions tool (#13092) 2026-03-08 20:23:06 -07:00
rollout.rs feat: polluted memories (#13008) 2026-03-02 11:57:32 +00:00