Repository navigation
[release/17.0] Use TimeProvider for SealedSecret sync-wait budget to fix SealedSecretApplyStepTests flake - #22017
Closed
Mitch Denny (mitchdenny) wants to merge 1 commit into
Conversation
…tApplyStepTests flake (#21530) ## Description Fixes #19662 `SealedSecretApplyStepTests.WaitForSealedSecretSynced_StatusMatchesButSecretAbsent_KeepsWaitingThenTimesOut` is flaky on CI. ### Root cause `WaitForSealedSecretSyncedAsync` and `InvokeProbeWithRemainingBudgetAsync` measured their budget against the wall clock (`DateTimeOffset.UtcNow` and `CancelAfter`). #19555 raised the test budget from 10ms to 250ms, but the test still failed on main on 10-12: under CI load, a slow first iteration (cold JIT, thread-pool starvation) can use up the whole budget before the second poll, so the loop times out after observing the absent Secret only once. ### Fix Inject a `TimeProvider` into the budget calculation, the probe timeout (`CancellationTokenSource(remaining, timeProvider)`) and the poll delay. Production passes `TimeProvider.System`, so runtime behavior is unchanged. The test now uses `FakeTimeProvider`: it waits until the second probe signals that it started, then calls `Advance` to exhaust the budget. The budget therefore only elapses after the loop has demonstrably kept waiting, regardless of runner speed. `Microsoft.Extensions.TimeProvider.Testing` is already centrally versioned in `Directory.Packages.props`; the test project only references it. ### Evidence - **Fail-before / pass-after:** with a 300ms stall injected into the first iteration, the old code failed 3/3 with the CI signature and the fixed code passed 5/5. - **Under load:** the `SealedSecretApplyStepTests` class passed 30/30 under CPU load. - **Full project:** `Aspire.Hosting.Radius.Tests` passed 669 tests, 0 failed. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [ ] Yes - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - [x] No **🤖 Posted by AspireAgent (AI Agent)** Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit c37dfbe)
14 tasks
This comment has been minimized.
This comment has been minimized.
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-20-pr21530
branch
from
November 10, 2026 04:22
55595f3 to
2e42689
Compare
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22017Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22017" |
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-20-pr21530
branch
from
November 10, 2026 04:24
2e42689 to
55595f3
Compare
Mitch Denny (mitchdenny)
marked this pull request as ready for review
November 10, 2026 04:55
Member
Author
|
Approved for inclusion in release/17.0. Do not merge yet. |
Contributor
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-20-pr21530
branch
from
November 10, 2026 05:40
55595f3 to
6dfb42f
Compare
Mitch Denny (mitchdenny)
requested review from
James Newton-King (JamesNK),
Adam Ratzman (adamint),
David Negstad (danegsta),
David Fowler (davidfowl),
Eric Erhardt (eerhardt),
Ella Hathaway (ellahathaway),
Karol Zadora-Przylecki (karolz-ms) and
Ankit Jain (radical)
as code owners
November 10, 2026 05:40
This comment has been minimized.
This comment has been minimized.
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-20-pr21530
branch
2 times, most recently
from
November 10, 2026 07:24
55595f3 to
6dfb42f
Compare
Mitch Denny (mitchdenny)
changed the base branch from
mitchdenny-backport-17-0-19-pr21304
to
mitchdenny-backport-17-0-18-pr21545
November 10, 2026 08:18
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-20-pr21530
branch
from
November 10, 2026 09:05
6dfb42f to
55595f3
Compare
Mitch Denny (mitchdenny)
changed the base branch from
mitchdenny-backport-17-0-18-pr21545
to
mitchdenny-backport-17-0-19-pr21304
November 10, 2026 09:45
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Backport of #21530 to
release/17.0(cherry-picked from c37dfbe with no modifications). Layer 20 of 55 in the release/17.0 backport stack; stacked on #22016.Backport recommendation: No — Test-flake fix.
Backport of #21530
Checklist
<remarks />and<code />elements on your triple slash comments?