Client timeout test now avoids internet access
1.1.1.2, as defined in the current code, runs a port 80 web server that responds to HTTP requests. Thus the timeout code is not doing a timeout test, but rather testing against a web server that doesn't understand the Arista API.
This PR fixes that, but also exposes what I documented in #61 - I.E. that a hardcoded 60 second timeout exists in Connect(), thus client_test.go unit tests now take 65s to run, thus it may be a good idea to address #61 so that timeout on connect is configurable as well.
Yes, there are two things here:
-
The hardcoded timeout (there would need to be a way to control that I think)
-
The test wasn't actually testing a timeout, it was testing a connection refused. This PR fixes the second of these. I did not implement the fix for the first one.
Yes, there are two things here:
- The hardcoded timeout (there would need to be a way to control that I think)
- The test wasn't actually testing a timeout, it was testing a connection refused. This PR fixes the second of these. I did not implement the fix for the first one.
Agree that this test is not for testing the timeout. But 65s for a test case to run is huge in my opinion. I would highly suggest fixing issue 1 in this PR.