Skip to content

Fix slow tests by adding IAcrImageImporter abstraction#1996

Open
lbussell wants to merge 2 commits intodotnet:mainfrom
lbussell:slow-tests
Open

Fix slow tests by adding IAcrImageImporter abstraction#1996
lbussell wants to merge 2 commits intodotnet:mainfrom
lbussell:slow-tests

Conversation

@lbussell
Copy link
Member

@lbussell lbussell commented Mar 3, 2026

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
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