Skip to content

robustly: wait timeout seconds between attempts - #4283

Open
madhavzanwar wants to merge 1 commit into
PecanProject:developfrom
madhavzanwar:GH-4280-robustly-ignores-timeout
Open

madhavzanwar wants to merge 1 commit into
PecanProject:developfrom
madhavzanwar:GH-4280-robustly-ignores-timeout

Conversation

@madhavzanwar

Copy link
Copy Markdown
Contributor

Description

robustly() documents timeout as the pause between attempts but never slept, so all n attempts ran back to back. It now calls Sys.sleep(timeout) after a failed attempt when another attempt follows; there is no sleep after the last attempt, before the final error.

Behaviour note: callers that pass a timeout (download.NARR_site() with n = 20, timeout = 1) will now actually wait between retries, which is the documented intent.

The new test stubs Sys.sleep with mockery, so it does not really sleep and is not timing-dependent. It fails on develop and passes with the fix.

Motivation and Context

Fixes #4280

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I agree that PEcAn Project may distribute my contribution under any or all of
    • the same license as the existing code,
    • and/or the BSD 3-clause license.
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@madhavzanwar
madhavzanwar marked this pull request as ready for review November 27, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

robustly() ignores its timeout argument

1 participant