-
Notifications
You must be signed in to change notification settings - Fork 267
Fix slow tests #6505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix slow tests #6505
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses slow-running unit tests by eliminating unnecessary network dependencies and retry delays in test execution.
Changes:
- Fixed graph SDK tests by properly disabling retries in mock client configuration
- Removed dependency on Maven Central in appdetect tests by converting fixtures to use local parent module references
- Changed CI default test recording mode from "live" to "playback" to prevent unnecessary network calls
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| eng/scripts/Set-CliBuildVariables.ps1 | Changed default AZURE_RECORD_MODE from "live" to "playback" to avoid network calls in CI |
| cli/azd/test/mocks/mockgraphsdk/mocks.go | Added MaxRetries and MaxRetryDelay settings to properly disable retries in tests |
| cli/azd/internal/appdetect/testdata/java-multimodules/notmodule/pom.xml | Removed external Spring Boot parent reference to eliminate Maven Central dependency |
| cli/azd/internal/appdetect/testdata/java-multimodules/module2/submodule1/pom.xml | Changed parent to local java-multimodules project instead of external Spring Boot |
| cli/azd/internal/appdetect/testdata/java-multimodules/module2/pom.xml | Changed parent to local java-multimodules project instead of external Spring Boot |
| cli/azd/internal/appdetect/testdata/java-multimodules/library/pom.xml | Changed parent to local java-multimodules project instead of external Spring Boot |
| cli/azd/internal/appdetect/testdata/java-multimodules/application/pom.xml | Changed parent to local java-multimodules project and added explicit dependency versions |
| cli/azd/internal/appdetect/java_test.go | Removed entire test file that was testing Maven's external behavior rather than azd functionality |
8a31a68 to
8e9c00d
Compare
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Address slow running unit tests, by making the following changes:
Fix pkg/graphsdk tests taking a long time to run due to retry policy kicking in. This change reduces the runtime from 3 minutes to <1 second.
Fix appdetect tests taking a dependency on live network calls to Maven Central. These tests were slow and flaky. To fix this, I: 1. Updated test fixtures to use local Maven module references instead, and 2. Removed java_test.go which was asserting external maven behavior, but otherwise offering limited use covering the actual product code, which looks like:
Following up from #6088 , I also noticed that the CI builds are running in live mode due to a separate configuration elsewhere that has been updated with this change.
Fixes #6503