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

Bug: Artillery won't exit once the test is done #215

Closed
hassy opened this issue Nov 28, 2016 · 17 comments · Fixed by artilleryio/artillery-core#128
Closed

Bug: Artillery won't exit once the test is done #215

hassy opened this issue Nov 28, 2016 · 17 comments · Fixed by artilleryio/artillery-core#128
Labels

Comments

@hassy
Copy link
Member

hassy commented Nov 28, 2016

Affected versions: tested on 1.5.0-16 and 1.5.0-17

Debug log: http://hastebin.com/sasidexamo.vbs

Reported by @sjb933.

@hassy hassy added the bug label Nov 28, 2016
@hassy
Copy link
Member Author

hassy commented Nov 29, 2016

I've not been able to replicate with v1.5.0-16 and a simple test script that sends a bunch of requests to an endpoint that ends up timing out.

@sjb933 Is there any other output on the terminal after "All phases launched" is printed? There should be more output (either printing the number of pending request/scenarios or saying that all scenarios have completed). Does the spinner still run?

Also could you try running Artillery directly just to make sure that it's Artillery that doesn't exit rather than the shell script wrapping it?

@gboysko
Copy link
Contributor

gboysko commented Nov 30, 2016

Hey @hassy, how did you get the debug log? Is this automatically generated? I am encountering a case where the workload is done, but Artillery keeps running indefinitely.

@hassy
Copy link
Member Author

hassy commented Dec 1, 2016

@gboysko debug info will be printed if you run DEBUG=artillery:runner,runner,http,socketio artillery run .... Which version of Artillery and Node.js are you on?

@gboysko
Copy link
Contributor

gboysko commented Dec 1, 2016

We are using the latest (1.5.0-16) with Node 6.x. I'll make sure to enable that so that we can understand the hanging condition.

@sjb933
Copy link

sjb933 commented Dec 2, 2016

Hi @hassy apologies I have not been able to provide more information. This issue arose during a work project and we're now beyond the point where I am able to test/reproduce. I hope that @gboysko can provide additional information that will help.

Thanks for the hard work!

@gboysko
Copy link
Contributor

gboysko commented Dec 2, 2016

FWIW, we are unable to reproduce the hanging condition at this time. However, we are armed with the DEBUG settings the next time it happens!

@hassy
Copy link
Member Author

hassy commented Dec 3, 2016

@gboysko if you see it again please do share the logs. :-)

@joeldodson
Copy link

Hi @hassy, @gboysko, @sjb933,

I'm seeing the same behavior. The run finishes and artillery continues to run until I ctrl-c it.

If I run 60 seconds at 10 virtual users artillery will generally stop. If I run 20 virtual users, it does not stop.

I'm using versions:

[artillery] $ artillery --version
1.5.0-17
[artillery] $ node --version
v6.9.1

I ran with command:

DEBUG=artillery:runner,runner,http,socketio artillery run add_token.json

but the debug output didn't look very useful. It showed the HTTP requests and a line for each runner:

runner picking scenario 0 (Add token) weight = 1 +47ms

and after all the requests had finished, I get the all phases launched and ever 10 seconds the same report with NaN.

\ runner All phases launched +22ms

Report for the previous 10s @ 2016-12-07T01:08:11.643Z
Scenarios launched: 0
Scenarios completed: 0
Requests completed: 0
RPS sent: NaN
Request latency:
min: NaN
max: NaN
median: NaN
p95: NaN
p99: NaN
Scenario duration:
min: NaN
max: NaN
median: NaN
p95: NaN
p99: NaN

Here's my JSON:
{
"config": {
"target": "http://127.0.0.1:8000",
"phases": [
{
"duration": 60,
"arrivalRate": 20,
"name": "Stress"
}
],
"payload": {
"path": "name_and_token.csv",
"fields": [
"name",
"token"
],
"order": "sequence"
}
},
"scenarios": [
{
"name": "Add token",
"flow": [
{
"post": {
"url": "/api/v1/register",
"json": {
"name": "{{ name }}",
"token": "{{ token }}",
"os": "testing",
"app_name": "com.example",
"production": false,
"overwrite": true
}
}
}
]
}
]
}

I can reproduce this consistently. Unfortunately it's on a service I'm writing for work. I have a personal/generic node/express app I use to play around to learn. I'll try and reproduce the issue on that and send you the github link.

thanks,
Joel

@joeldodson
Copy link

here's the output from

[artillery] $ DEBUG=artillery:runner,runner,http,socketio artillery run add_token.json > debugoutput.txt 2>&1

debugoutput.txt

@hassy
Copy link
Member Author

hassy commented Dec 7, 2016

@joeldodson very useful, thank you! I'm able to reproduce the issue with the info you provided. 👍

hassy added a commit to hassy/artillery that referenced this issue Dec 7, 2016
@hassy
Copy link
Member Author

hassy commented Dec 7, 2016

So the issue seems to be caused by a bug in Node.js v6.8.1 and above, quite possibly the bug that caused #204:

Bug report: nodejs/node#9756
PR: nodejs/node#9759

I haven't isolated the code in Artillery itself that triggers the bug yet, but the test case will hang reliably on Node.js 6.8.1 and above, and work fine on 6.8.0 or 4.x.

@gboysko @sjb933 @joeldodson The solution is to use Node.js =<6.8.0 until the bug in Node is fixed.

EDIT: Confirmed the bug in Node.js is responsible by running the test case with a Node.js binary with the patch applied.

@gboysko
Copy link
Contributor

gboysko commented Dec 7, 2016

Great job, @hassy. I can't be certain, but I feel that I've seen the hanging condition in Node 4.x as well. However, at the time, it was also an older version of artillery.

If we see the hanging condition again, we will resort to Node.js v6.8.0.

@joeldodson
Copy link

Thanks @hassy. I'm running artillery under node 6.7 now (already had that installed) and it's working great. I'll stay with that for the time being.
Thanks for the artillery project, it's very useful.

hassy added a commit to hassy/artillery-core that referenced this issue Dec 8, 2016
- New faster implementation of rampTo
- Improved test case for rampTo (accurate expected calculation)
- Add regression test for artilleryio/artillery#215
- Use arrivals@2.1.0 (fixes artilleryio/artillery#215)
@hassy
Copy link
Member Author

hassy commented Dec 8, 2016

I have rewritten the code inside Artillery that triggered the bug. I think we should be OK even on Node.js 6.8.1+ now.

hassy added a commit to hassy/artillery that referenced this issue Dec 8, 2016
hassy added a commit to hassy/artillery that referenced this issue Dec 8, 2016
hassy added a commit to hassy/artillery that referenced this issue Dec 8, 2016
hassy added a commit to hassy/artillery that referenced this issue Dec 8, 2016
@hassy
Copy link
Member Author

hassy commented Dec 8, 2016

v1.5.0-19 with the fixes is out now - https://github.com/shoreditch-ops/artillery/releases/tag/1.5.0-19

@joeldodson
Copy link

thanks @hassy! it's working great.

@honarkhah
Copy link

Drop the latest link that will resolve the issue to help people to find it easier as this is the first link on search!

#1799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants