test(gradle): retry gradle plugin integration test on network failures - #1665
Open
lengau wants to merge 2 commits into
Open
test(gradle): retry gradle plugin integration test on network failures#1665lengau wants to merge 2 commits into
lengau wants to merge 2 commits into
Conversation
The test_gradle_plugin integration test downloads the Gradle distribution via the gradlew wrapper, which occasionally fails with transient HTTP errors (e.g. 503) from services.gradle.org. Mark the test as flaky with reruns so these network hiccups don't fail CI, following the same pattern already used for other network-dependent tests (e.g. test_chisel_lifecycle.py, test_chisel.py). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces CI flakiness in the Gradle plugin integration suite by retrying test_gradle_plugin when it fails with PluginBuildError, which can occur during transient network failures while the Gradle wrapper downloads its distribution.
Changes:
- Mark
test_gradle_pluginas flaky withreruns=3when the failure is aPluginBuildError. - Add a clear reason string documenting the network-dependent failure mode (Gradle wrapper distribution download).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Fixes flaky gradle integration test failures such as seen in https://github.com/canonical/craft-parts/actions/runs/31634098513/job/94239938405.
Root cause
test_gradle_plugin(whenuse_gradlew=True) runs the Gradle wrapper, which downloads the Gradle distribution zip fromservices.gradle.org. This occasionally fails with a transient503HTTP error, causing aPluginBuildErrorand failing the test even though there's no actual bug in craft-parts.Fix
Marked
test_gradle_pluginwith@pytest.mark.flaky(reruns=3, only_rerun=["PluginBuildError"]), following the same established pattern used for other network-dependent integration tests in this repo (test_chisel.py,test_chisel_lifecycle.py,test_process.py).Verified: file collects successfully with
pytest --collect-only, syntax andruff checkpass.