Skip to content

Address flaky CI in networking steps #658

@nathanjmcdougall

Description

@nathanjmcdougall

The CI seems to be flaky for this step:

https://github.com/pypest/pyemu/blob/5dd3c785991ec991974c53cd0b1058281a2f872f/.github/workflows/ci.yml#L118-L121}

It's failing with Error 504: Gateway Time-out for quite a few PRs

Details
Run get-pestpp --owner pestpp --repo pestpp-nightly-builds :home
Matplotlib is building the font cache; this may take a moment.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\runneradmin\micromamba\envs\pyemu\Scripts\get-pestpp.exe\__main__.py", line 6, in <module>
    sys.exit(cli_main())
             ~~~~~~~~^^
  File "D:\a\pyemu\pyemu\pyemu\utils\get_pestpp.py", line 803, in cli_main
    run_main(**args, _is_cli=True)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "D:\a\pyemu\pyemu\pyemu\utils\get_pestpp.py", line 481, in run_main
    urllib.request.urlretrieve(download_url, download_pth)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\runneradmin\micromamba\envs\pyemu\Lib\urllib\request.py", line 214, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
                            ~~~~~~~^^^^^^^^^^^
  File "C:\Users\runneradmin\micromamba\envs\pyemu\Lib\urllib\request.py", line 189, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\runneradmin\micromamba\envs\pyemu\Lib\urllib\request.py", line 495, in open
    response = meth(req, response)
  File "C:\Users\runneradmin\micromamba\envs\pyemu\Lib\urllib\request.py", line 604, in http_response
    response = self.parent.error(
        'http', request, response, code, msg, hdrs)
  File "C:\Users\runneradmin\micromamba\envs\pyemu\Lib\urllib\request.py", line 533, in error
    return self._call_chain(*args)
           ~~~~~~~~~~~~~~~~^^^^^^^
  File "C:\Users\runneradmin\micromamba\envs\pyemu\Lib\urllib\request.py", line 466, in _call_chain
    result = func(*args)
  File "C:\Users\runneradmin\micromamba\envs\pyemu\Lib\urllib\request.py", line 613, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 504: Gateway Time-out
auto-selecting option ':home' for 'bindir'

Fetched release '20251214' info from 'pestpp/pestpp-nightly-builds'.

Downloading 'https://github.com/pestpp/pestpp-nightly-builds/releases/download/20251214/pestpp-5.2.24dev20251214-win.zip' to 'C:\Users\runneradmin\Downloads\pestpp-20251214-pestpp-5.2.24dev20251214-win.zip'.
Error: Process completed with exit code 1.

I would start by adding a retry logic, e.g. with

 run: |
    for i in {1..5}; do
      get-pestpp --owner pestpp --repo pestpp-nightly-builds :home && break
      echo "Retry in 10 seconds..."
      sleep 10
    done

In the future, it might be worth considering a cache for the version downloads to reduce changes of getting API rate limited etc. But since they're nightly builds, it might not add as much value to do that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions