-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CSHARP-5784: Execute dotnet restore with retries on Evergreen #1816
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?
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 implements retry logic for dotnet restore operations in the Evergreen CI environment to handle transient network failures. The main changes include introducing a new compilation script with retry logic and updating the build pipeline configuration.
- Introduces retry mechanism for dotnet restore with exponential backoff (up to 5 attempts)
- Refactors build pipeline to separate compilation from test execution
- Removes unused build configuration files and Cake build tasks
- Wraps DEBUG-only test assertions with conditional compilation directives for CSOT feature
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| evergreen/compile-sources.sh | New script implementing dotnet restore with retry logic and exponential backoff |
| evergreen/evergreen.yml | Adds compile-sources function and integrates it into all test tasks; removes upload-working-dir function |
| evergreen/run-unit-tests.sh | Updates test command to use Release configuration and removes separate build step |
| tests/MongoDB.Driver.Tests/MongoUrlTests.cs | Wraps CSOT Timeout property tests with DEBUG conditional compilation |
| tests/MongoDB.Driver.Tests/MongoUrlBuilderTests.cs | Wraps CSOT Timeout property tests with DEBUG conditional compilation |
| tests/MongoDB.Driver.Tests/Core/Configuration/ConnectionStringTests.cs | Wraps CSOT Timeout property tests with DEBUG conditional compilation |
| build.cake | Removes Build, Package, and PushToNuGet tasks, keeping only test execution tasks |
| tools/packages.config | Removes Cake dependency configuration file |
| evergreen/set-virtualenv.sh | Removes Python virtual environment setup script |
| evergreen/install-dotnet.sh | Updated path reference in evergreen.yml (not shown in diffs) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| dotnet build | ||
| dotnet test --no-build --filter "Category!=Integration" -f "$FRAMEWORK" --results-directory ./build/test-results --logger "junit;verbosity=detailed;LogFileName=TEST-{assembly}.xml;FailureBodyFormat=Verbose" --logger "console;verbosity=detailed" | ||
| dotnet test -c Release --no-build --filter "Category!=Integration" -f "$FRAMEWORK" --results-directory ./build/test-results --logger "junit;verbosity=detailed;LogFileName=TEST-{assembly}.xml;FailureBodyFormat=Verbose" --logger "console;verbosity=detailed" |
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.
Should execute compile-sources as well?
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.
As it was discussed: I've reworked the scripts to execute compile-sources.sh from the run-tests.sh
| fi | ||
|
|
||
| DELAY=$((ATTEMPT * RESTORE_RETRY_DELAY_SECONDS_MULTIPLIER)) | ||
| echo "dotnet restore failed. Retrying in $DELAY seconds..." |
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.
nit: Add ATTEMPT in the log message.
No description provided.