Skip to content

Conversation

@gampnico
Copy link
Contributor

@gampnico gampnico commented Oct 30, 2025

In some CI environments or with low speed internet connections, HAS_INTERNET will return False due to a TimeoutError. This is a really rare bug. See DTCG logs here (requires authentication) and OGGM logs here.

This fix speeds up the connection time by avoiding a DNS lookup and application layer connection through HTTP. urlopen will also return a TimeoutError if the DNS lookup fails.

Points for discussion:

  • Internet access does not guarantee access to the data located at base_url. However, I don't recommend pinging the cluster every time someone runs a test.
  • I've set the address to 8.8.8.8 as this is Google's public DNS, instead of http://google.com. It may be better to connect to example.com as this is managed by ICANN, but they don't recommend using this address operationally.
  • This function is run inside the test suite's init file. How should I add a test? Or can this be left uncovered?
  • Tests added/passed
  • Fully documented
  • Entry in whats-new.rst

In some CI environments or low speed connections, ``HAS_INTERNET`` will
return False due to a TimeoutError.

This fix speeds up the connection speed by avoiding a DNS lookup and
application layer connection through HTTP. ``urlopen`` will also return
a TimeoutError if the DNS lookup fails.
@fmaussion
Copy link
Member

Fine by me! This doesn't need tested.

@TimoRoth any opinion on this?

@fmaussion fmaussion merged commit 068abea into OGGM:dev Nov 11, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants