Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test hangs #1223

Closed
naissa12 opened this issue Oct 14, 2016 · 4 comments
Closed

Test hangs #1223

naissa12 opened this issue Oct 14, 2016 · 4 comments

Comments

@naissa12
Copy link

I have a suite of tests. Sometimes, one of the test hangs. It seems like it is not getting a response from selenium. Is there better error handling that can be added when this happens so that the test can retry? Right now it hangs and doesn't retry. It's one test out of the full suite that hangs.

@NickStefan
Copy link
Contributor

NickStefan commented Oct 20, 2016

Same problem. We need to add a timeout and retry logic to the actual http request between nightwatch and selenium. Setting the page load timeout on seleneium, in a before each, does not work:

browser.timeouts('page load', 30000)

because the "hanging" sometimes happens before even that "before" code runs. This pointed me to go look at the HTTP logic here. There's no timeout or retry logic in the http module of this library.

@NickStefan
Copy link
Contributor

So I think this is actually more related to this: #470

I monkey patched nightwatch/libs/http/request.js to listen for the timeout event:

self.request.setTimeout(30000, function(){
    console.log('timeout');
     self.emit('error', {});
})

Sure enough, every time our tests had been merely hanging before, this was triggered. Only now, with the error tigger, it helped surface that the selenium server had basically died on the CI server.

I still dont have a solution for selenium server randomly falling over...

@NickStefan
Copy link
Contributor

Now I'm not so sure. Doing health check against the selenium server and it continues to respond to curl requests even when a random test has a timeout

@beatfactor
Copy link
Member

Fixed as part of #1232.

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

No branches or pull requests

3 participants