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

Tests failed for reason of timeout. #80

Closed
AlyonaGavrylei opened this issue Mar 26, 2014 · 13 comments
Closed

Tests failed for reason of timeout. #80

AlyonaGavrylei opened this issue Mar 26, 2014 · 13 comments

Comments

@AlyonaGavrylei
Copy link

Hello, help please to resolve problem. While my tests are running one by one in script some of them are failed for reason of timeout 5000ms. How can I fix this problem?
Thanks.

@vlucas
Copy link
Owner

vlucas commented Mar 26, 2014

You can increase the timeout if you like via globalSetup:

frisby.globalSetup({
  timeout: 10000
});

@moses-gangipogu
Copy link

var frisby = require('./lib/frisby');
// Global setup for all tests
frisby.globalSetup({
request: {
headers:{'Accept': 'application/json, application/x-httpd-php', 'Cookie': 'authenticationToken=5363; activationID=11123fgf'}
},
timeout: (30 * 1000)
});
/**
* Tests -> GET
*/
frisby.create(' ')
.get('http://xyz/auto?limit=0')
.expectStatus(200)
.expectHeaderContains('content-type', 'application/json')
.expectJSON('status',{
message: "DATABASE_ERROR",
code: 2
})
.toss();

TRY THIS

@AlyonaGavrylei
Copy link
Author

I'm already made earlier action in your first comment and it doesn't help me. Second - I did not check out yet. I'll try today. Thank you.

@vlucas
Copy link
Owner

vlucas commented Mar 27, 2014

Try putting .timeout(10000) on the actual frisby test. Also, if the URL is unreachable, Firsby will sometimes timeout instead of throwing an error, so be sure to check that the URL is correct as well.

@AlyonaGavrylei
Copy link
Author

Thank you guys!!!
A second solution help to run my tests. Here is example of header in all test_spec.js files:

var frisby = require("frisby"),
base_url = "http://test.test.test/api/1.0/replies";

frisby.globalSetup({
request: {
headers: {
'content-type': 'application/json'
}, timeout: (30*1000)
}
});

In current time all tests run successfully)

@vlucas vlucas closed this as completed Mar 27, 2014
@dguerrier
Copy link

If I run a group of tests in separate files as such
jasmine-node spec/apitest/
I get random 5000 timeouts even though I'm setting a global timeout in every file to 30000

If I run each file in it's own session like so, all is well
for i in spec/apitest/; do jasmine-node $i; done

@vlucas
Copy link
Owner

vlucas commented Sep 30, 2014

Yes unfortunately I have run into this as well. I am not sure the solution to this off hand - it's something I will have to look into (unless someone else can help!).

@clmathuriya
Copy link

I am also getting random 5000 timeouts even though I'm setting a global timeout in every file to 30000

@ravirkkm
Copy link

@vlucas
For me sometimes all the assertions are successful i.e., 0 failures, 0 skipped
and very next time a few assertions are failures.

    at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)

Finished in 8.695 seconds
3 tests, 10 assertions, 2 failure, 0 skipped

I've set the globalSetup timeout to 30000 and if you notice, frisby tests got finished in 8.695
Is this timeout issue ?

Earlier I did not have this issue in my other laptop (may be that was old version of frisby/nodejs)
After I installed latest version of nodejs / frisby , I face this issue.
Any one got the solution for this ?

@Gerst20051
Copy link

👍

@dguerrier
Copy link

Any movement on this?

@clmathuriya
Copy link

frisby.globalSetup({
timeout: 50000
});

worked for me.

@Haisenberh
Copy link

Haisenberh commented Jul 28, 2016

Worked for me
frisby.create("Export statements valid test")
.post(base_url, {
token: token
})
.expectStatus(200)
.expectJSON({
fileUrl: String
})
.timeout(60000) //waits 60sec for response
.toss();
});

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

8 participants