go-zookeeper / zk

Native ZooKeeper client for Go
BSD 3-Clause "New" or "Revised" License
515 stars 130 forks source link

add dns host provider lookup timeout #143

Closed MKrupauskas closed 4 months ago

MKrupauskas commented 4 months ago

Resolves #142 by adding a 3s timeout for DNS lookups. This is better behavior than having the call get stuck indefinitely when the DNS resolver isn't reachable.

Adjusted/added unit tests to verify.

$ go test -run ^TestNewDNSHostProvider$
PASS
ok      github.com/go-zookeeper/zk      0.207s
codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.60%. Comparing base (6585b41) to head (474e511).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #143 +/- ## ========================================== + Coverage 78.35% 78.60% +0.25% ========================================== Files 8 8 Lines 1349 1365 +16 ========================================== + Hits 1057 1073 +16 Misses 201 201 Partials 91 91 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.