Skip to content

BUG/TST: use sleep during instrument download tests #172

@jklenzing

Description

@jklenzing

Describe the bug
Sometimes during the instrument library tests, download tests will fail with a "maximum connections exceeded" error. This is likely because the downloads all occur sequentially, and for small files could trigger this.

Note this does not occur on github actions, possibly because the servers are slower or they use a dynamic IP, so the host IP is potentially different with every request.

Adding time.sleep(1) to the end of pysat.tests.classes.cls_instrument_library.test_download solves this issue locally. This adds a 1-second pause to this test, which may be enough to keep this bug from triggering.

To Reproduce
run pytest on the pysatNASA library from a local machine.

Expected behavior
tests should succeed and not annoy the data servers.

Additional context
Probably should review across packages to see if this affects others, or if the proposed solution is too onerous there.

UPDATE Noting this also occurs for downloading multiple small files, not just the tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions