Skip to content

RUST-2356 add appName to OIDC test failpoints#1611

Closed
kevinAlbs wants to merge 4 commits intomongodb:mainfrom
kevinAlbs:R2356
Closed

RUST-2356 add appName to OIDC test failpoints#1611
kevinAlbs wants to merge 4 commits intomongodb:mainfrom
kevinAlbs:R2356

Conversation

@kevinAlbs
Copy link
Contributor

Summary

Evergreen patch: https://spruce.mongodb.com/version/698b617d6baf4b00079d9304/

Background & Motivation

Intended to address transient test failures observed on GCP OIDC tasks (example). See mongodb/specifications#1891 for details. In short: Atlas processes appeared to sometimes trigger failpoints. The appName is intended to isolate failpoints to the test client.

@kevinAlbs kevinAlbs requested a review from a team as a code owner February 10, 2026 17:52
@kevinAlbs kevinAlbs requested review from Copilot and isabelatkinson and removed request for isabelatkinson February 10, 2026 17:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an appName to OIDC-related failpoint configurations to scope failpoints to the test client and reduce transient cross-client interference (e.g., Atlas-triggered commands).

Changes:

  • Set appName on the unified test client entity in the OIDC “no-retry” spec.
  • Add appName filters to relevant failCommand failpoints in both YAML and JSON unified test specs.
  • Update Rust OIDC spec tests to set client app_name and scope FailPoint builders via .app_name(...).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
spec/auth/unified/mongodb-oidc-no-retry.yml Defines a shared YAML anchor for appName and applies it to failpoints to scope them to the test client.
spec/auth/unified/mongodb-oidc-no-retry.json Mirrors the YAML changes by adding the same appName value throughout the JSON spec.
driver/src/test/spec/oidc.rs Sets ClientOptions.app_name and adds .app_name("rust-oidc") to failpoints to prevent unintentional triggering by other clients.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kevinAlbs kevinAlbs requested a review from Copilot February 10, 2026 18:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

test::spec::unified_runner::{TestFile, TestFileEntity},
};

const OIDC_APP_NAME: &str = "rust-oidc";
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two different OIDC_APP_NAME constants in scope: one defined in this file (\"rust-oidc\") and one imported (spec::oidc_skip_ci::OIDC_APP_NAME). Inside mod basic, the imported name shadows the file-level constant, which can cause ClientOptions.app_name and failpoint .app_name(...) to use an unintended value (or make the file-level const unused). Prefer a single source of truth: remove the import and reference super::OIDC_APP_NAME, or delete the file-level const and consistently use the imported one.

Suggested change
const OIDC_APP_NAME: &str = "rust-oidc";

Copilot uses AI. Check for mistakes.
test::{
spec::unified_runner::run_unified_tests,
Client, bson::{Document, doc}, client::auth::{AuthMechanism, Credential, oidc}, options::ClientOptions, test::{
spec::{oidc_skip_ci::OIDC_APP_NAME, unified_runner::run_unified_tests},
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two different OIDC_APP_NAME constants in scope: one defined in this file (\"rust-oidc\") and one imported (spec::oidc_skip_ci::OIDC_APP_NAME). Inside mod basic, the imported name shadows the file-level constant, which can cause ClientOptions.app_name and failpoint .app_name(...) to use an unintended value (or make the file-level const unused). Prefer a single source of truth: remove the import and reference super::OIDC_APP_NAME, or delete the file-level const and consistently use the imported one.

Suggested change
spec::{oidc_skip_ci::OIDC_APP_NAME, unified_runner::run_unified_tests},
spec::{unified_runner::run_unified_tests},

Copilot uses AI. Check for mistakes.
Comment on lines +80 to +83
Client, bson::{Document, doc}, client::auth::{AuthMechanism, Credential, oidc}, options::ClientOptions, test::{
spec::{oidc_skip_ci::OIDC_APP_NAME, unified_runner::run_unified_tests},
util::fail_point::{FailPoint, FailPointMode},
},
Client,
}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This use crate::{ ... } block was reformatted into a very dense single line, which makes it harder to review and maintain. Consider reverting to a multi-line grouped import (or just run rustfmt) to restore readability.

Copilot uses AI. Check for mistakes.
}))
.build()
.into();
opts.app_name = Some(OIDC_APP_NAME.into());
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting opts.app_name = Some(OIDC_APP_NAME.into()) is repeated in many test cases in this file. To reduce duplication and prevent future inconsistencies, consider introducing a small helper (e.g., fn set_oidc_app_name(opts: &mut ClientOptions)) and calling it wherever the OIDC test client is constructed.

Copilot uses AI. Check for mistakes.
@kevinAlbs
Copy link
Contributor Author

Closing for #1611

@kevinAlbs kevinAlbs closed this Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments