app-server: fix Bazel clippy in tracing tests#18872
Merged
Merged
Conversation
pakrym-oai
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
PR #18431 exposed a Bazel clippy failure in the app-server unit-test target across Linux, macOS, and Windows. The failing lint was
clippy::await_holding_invalid_type: two tracing tests serialized access to global tracing state by holding atokio::sync::MutexGuardacross awaited test work.That serialization is still needed because the tests share process-global tracing setup and exporter state, but it should not require holding an async mutex guard through the whole test body.
What changed
tracing_test_guardhelper withserial_teston the two tracing tests that need global tracing serialization.#[expect(clippy::await_holding_invalid_type)]annotations and the lock guard callsites that Bazel clippy rejected.Validation
cargo test -p codex-app-server jsonrpc_spanjust fix -p codex-app-servergit diff --checkI also attempted the exact failing Bazel clippy target locally with BuildBuddy disabled:
bazel --noexperimental_remote_repo_contents_cache build --config=clippy --bes_backend= --remote_cache= --experimental_remote_downloader= -- //codex-rs/app-server:app-server-unit-tests-bin. That run did not reach clippy because Bazel timed out downloadinglibcap-2.27.tar.gzfromkernel.org.