Skip to content

Windows CI tests regularly failing due to issues with cached remote files for sph2grd #1602

Closed
@maxrjones

Description

@maxrjones

We seem to be semi-regularly getting failures on windows-latest - Python 3.7 / NumPy 1.18 with :
..\tests\test_sph2grd.py::test_sph2grd_outgrid FAILED [ 87%]
..\tests\test_sph2grd.py::test_sph2grd_no_outgrid FAILED [ 87%]
due to issues with the remote file.

Originally posted by @meghanrjones in #1242 (comment)

Full error message at https://github.com/GenericMappingTools/pygmt/runs/4099608763?check_suite_focus=true#step:11:578:

____________________________ test_sph2grd_outgrid _____________________________

    def test_sph2grd_outgrid():
        """
        Test sph2grd with a set outgrid.
        """
        with GMTTempFile(suffix=".nc") as tmpfile:
>           result = sph2grd(
                data="@EGM96_to_36.txt", outgrid=tmpfile.name, spacing=1, region="g"
            )

C:\Miniconda3\envs\pygmt\lib\site-packages\pygmt\tests\test_sph2grd.py:16: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda3\envs\pygmt\lib\site-packages\pygmt\helpers\decorators.py:586: in new_module
    return module_func(*args, **kwargs)
C:\Miniconda3\envs\pygmt\lib\site-packages\pygmt\helpers\decorators.py:726: in new_module
    return module_func(*args, **kwargs)
C:\Miniconda3\envs\pygmt\lib\site-packages\pygmt\src\sph2grd.py:75: in sph2grd
    lib.call_module("sph2grd", arg_str)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <pygmt.clib.session.Session object at 0x000002E91CE65370>
Error:  [ERROR]: Cannot find file C:/Users/runneradmin/.gmt/cache/EGM96_to_36.txt
Error:  [ERROR]: File C:/Users/runneradmin/.gmt/cache/EGM96_to_36.txt not found
[Session pygmt-session (1719)]: Error returned from GMT API: GMT_FILE_NOT_FOUND (16)
___________________________ test_sph2grd_no_outgrid ___________________________

    def test_sph2grd_no_outgrid():
        """
        Test sph2grd with no set outgrid.
        """
>       temp_grid = sph2grd(data="@EGM96_to_36.txt", spacing=1, region="g")

C:\Miniconda3\envs\pygmt\lib\site-packages\pygmt\tests\test_sph2grd.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda3\envs\pygmt\lib\site-packages\pygmt\helpers\decorators.py:586: in new_module
    return module_func(*args, **kwargs)
C:\Miniconda3\envs\pygmt\lib\site-packages\pygmt\helpers\decorators.py:726: in new_module
    return module_func(*args, **kwargs)
C:\Miniconda3\envs\pygmt\lib\site-packages\pygmt\src\sph2grd.py:75: in sph2grd
    lib.call_module("sph2grd", arg_str)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <pygmt.clib.session.Session object at 0x000002E91CEC3BB0>
module = 'sph2grd'
args = '@EGM96_to_36.txt -GC:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\pygmt-1jo39m30.nc -I1 -Rg'

    def call_module(self, module, args):
        """
        Call a GMT module with the given arguments.
    
        Makes a call to ``GMT_Call_Module`` from the C API using mode
        ``GMT_MODULE_CMD`` (arguments passed as a single string).
    
        Most interactions with the C API are done through this function.
    
        Parameters
        ----------
        module : str
            Module name (``'coast'``, ``'basemap'``, etc).
        args : str
            String with the command line arguments that will be passed to the
            module (for example, ``'-R0/5/0/10 -JM'``).
    
        Raises
        ------
        GMTCLibError
            If the returned status code of the function is non-zero.
        """
        c_call_module = self.get_libgmt_func(
            "GMT_Call_Module",
            argtypes=[ctp.c_void_p, ctp.c_char_p, ctp.c_int, ctp.c_void_p],
            restype=ctp.c_int,
        )
    
        mode = self["GMT_MODULE_CMD"]
        status = c_call_module(
            self.session_pointer, module.encode(), mode, args.encode()
        )
        if status != 0:
>           raise GMTCLibError(
                f"Module '{module}' failed with status code {status}:\n{self._error_message}"
            )
E           pygmt.exceptions.GMTCLibError: Module 'sph2grd' failed with status code 16:
Error:      sph2grd [ERROR]: Libcurl Error: Timeout was reached
Error:      sph2grd [ERROR]: File C:/Users/runneradmin/.gmt/cache/EGM96_to_36.txt was not found
Error:      sph2grd [ERROR]: Cannot find file C:/Users/runneradmin/.gmt/cache/EGM96_to_36.txt
Error:      sph2grd [ERROR]: File C:/Users/runneradmin/.gmt/cache/EGM96_to_36.txt not found

C:\Miniconda3\envs\pygmt\lib\site-packages\pygmt\clib\session.py:500: GMTCLibError

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceBoring but important stuff for the core devs

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions