Skip to content

Commit 39efc76

Browse files
Rust e2e: skip the two multi-client BYOK provider tests in-process
The runtime registers the LLM inference provider per connection and, by design, never releases the slot on disconnect (runtime shared_api/llm_inference.rs). Over the in-process transport every client shares this process's runtime, so a second provider-registering client is refused ('Another client is already the LLM inference provider') — deterministically failing reacquires_a_fresh_token_for_each_ request and dispatches_token_acquisition_per_provider when they run after the first BYOK test. stdio spawns a separate child per test, so all three run there. The BYOK bearer-token path over the in-process transport is validated by callback_token_is_applied_as_authorization_header (still runs in-process); the per-request / per-provider dispatch these two exercise is transport-agnostic and fully covered over stdio. Guard them with skip_inprocess, matching the branch's pattern for genuine in-process runtime limitations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7fcf82b commit 39efc76

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

rust/tests/e2e/byok_bearer_token_provider.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,18 @@ async fn callback_token_is_applied_as_authorization_header() {
189189

190190
#[tokio::test]
191191
async fn reacquires_a_fresh_token_for_each_request() {
192+
// The runtime registers the LLM inference provider per connection and, by design,
193+
// never releases the slot on disconnect (runtime `shared_api/llm_inference.rs`). Over
194+
// the in-process transport every client shares this process's runtime, so a second
195+
// provider-registering client is refused ("Another client is already the LLM
196+
// inference provider"). The BYOK bearer-token behavior over the in-process transport
197+
// is covered by `callback_token_is_applied_as_authorization_header`; this scenario's
198+
// provider-dispatch logic is transport-agnostic and is covered over stdio.
199+
if super::support::skip_inprocess(
200+
"llmInference.setProvider is process-global in-process; a second provider client is refused",
201+
) {
202+
return;
203+
}
192204
with_e2e_context_no_snapshot(|ctx| {
193205
Box::pin(async move {
194206
ctx.set_default_copilot_user();
@@ -252,6 +264,16 @@ async fn reacquires_a_fresh_token_for_each_request() {
252264

253265
#[tokio::test]
254266
async fn dispatches_token_acquisition_per_provider() {
267+
// See `reacquires_a_fresh_token_for_each_request`: in-process, the process-global LLM
268+
// inference provider registration is not released on disconnect, so this additional
269+
// provider-registering client is refused. The BYOK transport path is covered in-process
270+
// by `callback_token_is_applied_as_authorization_header`; the per-provider dispatch
271+
// logic exercised here is transport-agnostic and covered over stdio.
272+
if super::support::skip_inprocess(
273+
"llmInference.setProvider is process-global in-process; a second provider client is refused",
274+
) {
275+
return;
276+
}
255277
with_e2e_context_no_snapshot(|ctx| {
256278
Box::pin(async move {
257279
ctx.set_default_copilot_user();

0 commit comments

Comments
 (0)