-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Found a bug the script https://github.com/timotta/wrk-scripts/blob/master/multiplepaths.lua
Check out these lines:
if counter > #paths then
counter = 0
endThis will get you out of array boundary when counter = 0, since lua arrays' indices start from 1. In this case path variable will get nil value, thus the requested path will be /. It doesn't crash, but it may be not what's expected by a user. For example, if a service under test doesn't serve from /, wrk will output: "Non-2xx or 3xx responses: ..."
To reproduce, put these prints in the request function:
request = function()
path = paths[counter]
print ("counter: " .. counter)
print ("path: " .. (path or "empty"))
counter = counter + 1
if counter > #paths then
counter = 0
end
return wrk.format(nil, path)
endI will suggest a fix as a PR
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels