Skip to content

Fix flaky PackageUpdateResource temp key test - #7390

Merged
nkolev92 merged 2 commits into
devfrom
dev-nkolev92-fixSymbolPushFlake
May 14, 2026
Merged

nkolev92 merged 2 commits into
devfrom
dev-nkolev92-fixSymbolPushFlake

Conversation

@nkolev92

@nkolev92 nkolev92 commented May 13, 2026 •

Copy link
Copy Markdown
Member

Bug

Fixes: N/A (engineering/test-only change)

Description

This fixes flakiness in the temp verification key tests in PackageUpdateResourceTests.

The failing path was not limited to PackageUpdateResource_NoSymbolSourcePushingSymbolAsync. CI also failed in PackageUpdateResource_PackageNotExistOnNuGetOrgPushingAsync, and the failure stack was the same in both cases:

PackageUpdateResource.GetSecureApiKey(...) -> HttpSource.GetJObjectAsync(...) -> DownloadTimeoutStream.ReadAsync(...)

These tests all used a shared timeoutInSecond: 5, which was too aggressive for the mocked temp-key response path under CI jitter. This change introduces a dedicated test timeout constant (TempApiKeyRequestTimeoutInSeconds = 10) and uses it only for the temp-key scenarios, keeping the timeout bounded while removing incidental failures from the assertions these tests are actually making.

PR Checklist

  • Meaningful title and helpful description; no linked NuGet/Home issue is needed for this engineering/test-only change
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@nkolev92
nkolev92 requested a review from a team as a code owner May 13, 2026 17:30
@nkolev92 nkolev92 added the Engineering Changes related to the build infrastructure of the repo and that do not change product code label May 13, 2026
@nkolev92

Copy link
Copy Markdown
Member Author

lol, the test that failed was one the flakiness was supposed to fix.
THis is not enough.

@nkolev92

Copy link
Copy Markdown
Member Author

This is a copilot hopeful fix.
I looked at the stack myself and I couldn't really figure out another potential root casue.

@nkolev92
nkolev92 enabled auto-merge (squash) May 14, 2026 17:53
@nkolev92
nkolev92 merged commit 1ae83a6 into dev May 14, 2026
17 of 18 checks passed
@nkolev92
nkolev92 deleted the dev-nkolev92-fixSymbolPushFlake branch May 14, 2026 18:15
liliankasem pushed a commit to liliankasem/NuGet.Client that referenced this pull request May 19, 2026
Use TempApiKeyRequestTimeoutInSeconds (10s) instead of 5s, matching the
fix applied to sibling tests in NuGet#7390 to address TaskCanceledException
under CI load.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Engineering Changes related to the build infrastructure of the repo and that do not change product code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants