Repository navigation
Add retry mechanism for transient network/IO failures in test execution - #367
Closed
MikeWLloyd wants to merge 1 commit into
Closed
MikeWLloyd wants to merge 1 commit into
MikeWLloyd wants to merge 1 commit into
Conversation
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.
Summary
Add retry mechanism for transient network/IO failures.
When tests depend on remote files staged by Nextflow (e.g. from raw.githubusercontent.com), transient DNS or connection failures cause spurious test failures that are unrelated to the actual test logic. This PR adds a configurable retry mechanism that detects these failures and re-runs the affected test automatically.
What changed
•
TestExecutionEngine: on test failure, reads the Nextflow stderr/stdout error report and checks it against a list of known transient error patterns. If a match is found and attempts remain, the test directories are re-initialized and the test is re-executed.•
Config: new retries DSL field (default 0) so retry count can be set innf-test.config.•
RunTestsCommand: new--retries <N>CLI flag that overrides the config file value when provided.Detected error patterns:
• Could not resolve host (DNS failure)
• Can't stage file https:// / No such file or directory: https:// (Nextflow staging failure)
• curl: (6) / curl: (7) / curl: (28) / curl: (35) (various curl network errors)
• Connection timed out / Connection refused
Usage
In nf-test.config:
Or on the CLI:
CLI takes precedence over the config file value.
Testing
TestExecutionEngineRetryTestcovers five cases using lightweight stubs (no external mocking library):• retry succeeds before exhaustion → test passes,
execute()called the expected number of times• retries exhausted → test fails
• non-network error → no retry attempted
•
retries=0→ no retry even on network error• clean first-pass →
execute()called exactly once