robotframework-httplibrary icon indicating copy to clipboard operation
robotframework-httplibrary copied to clipboard

gai error in consecutive GET requests

Open GayanaYJ opened this issue 9 years ago • 4 comments

I am also encountering this gaierror alot which is a blocker for my testing.

13:28:41.532 FAIL gaierror: [Errno 8] nodename nor servname provided, or not known Below is my observation

I have around 600 uri in array for which i have to do GET request

. When i place it in for loop and send request one by one. I get response for all 247 uri , when it reaches 248 uri it fails there everytime. I have been googling alot but not able to find any relevant fix that i can put in place.

screen shot 2015-04-13 at 1 39 47 pm

GayanaYJ avatar Apr 14 '15 20:04 GayanaYJ

@GayanaYJ did you find a fix or workaround for this issue, I'm getting same error trying to request around 600 URI with GET, thanks in advance.

cgomeztk avatar Jan 05 '16 18:01 cgomeztk

@cgomeztk : Try inducing sleep of at least 5 second sleep before each consecutive request OR just set the http context once for all test cases(setup context). According to my analysis, this happens when there are too many consecutive API calls and trying to set http context for every call.

GayanaYJ avatar Jan 05 '16 19:01 GayanaYJ

hey @GayanaYJ thanks for your quick response, I found a workaround for this as well, I don't use "Create Http Context" keyword because the requests I do not always are to the same host, so I'm sending the absolute URL to the GET or HEAD request instead. So the workaround is adding "Restore Http Context" keyword before calling GET or HEAD, it successfully finished 609 requests, hope that helps. Cheers.

cgomeztk avatar Jan 05 '16 19:01 cgomeztk

@cgomeztk : Good to know about this workaround. Thank you

GayanaYJ avatar Jan 05 '16 19:01 GayanaYJ