goeapi icon indicating copy to clipboard operation
goeapi copied to clipboard

Client timeout test now avoids internet access

Open jmaslak opened this issue 11 months ago • 2 comments

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.

jmaslak avatar Jan 26 '25 15:01 jmaslak

Yes, there are two things here:

  1. The hardcoded timeout (there would need to be a way to control that I think)

  2. 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.

jmaslak avatar Apr 01 '25 22:04 jmaslak

Yes, there are two things here:

  1. The hardcoded timeout (there would need to be a way to control that I think)
  2. 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.

roopeshsn avatar Apr 06 '25 07:04 roopeshsn