Skip to content

Fix slow tests by adding IAcrImageImporter abstraction - #1996

Merged
lbussell merged 2 commits into
dotnet:mainfrom
lbussell:slow-tests
Mar 4, 2026
Merged

lbussell merged 2 commits into
dotnet:mainfrom
lbussell:slow-tests

Conversation

@lbussell

@lbussell lbussell commented Mar 3, 2026 •

Copy link
Copy Markdown
Member

git bisect found that #1975 caused ImageBuilder's test to slow down dramatically, increasing from ~3 seconds to 100+ seconds.

The test ImportImageAsync_ExternalSourceRegistry_DoesNotRequireSourceRegistryInPublishConfig calls CopyImageService.ImportImageAsync with isDryRun: false, which hits real ARM SDK methods through a mocked TokenCredential. Each call fails and RetryHelper retries 5 times with backoff as well, causing that single test to take over one minute.

This PR adds an abstraction for the ARM client which CopyImageService resolves via DI so that the test can mock it. All 424 tests now pass in ~5 seconds.

@lbussell
lbussell requested a review from a team as a code owner March 3, 2026 23:34
@lbussell lbussell changed the title Fix slow tests by adding IAcrRegistryImporter abstraction Fix slow tests by adding IAcrImageImporter abstraction Mar 3, 2026
@lbussell
lbussell merged commit d9a87e2 into dotnet:main Mar 4, 2026
12 checks passed
@lbussell
lbussell deleted the slow-tests branch March 4, 2026 17:09
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.

2 participants