-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Scenario:
local numberOfRequests = 6;
local app = Rocky({"timeout": 6});
local count = 0;
app.on("GET", "/test", function(context) {
// do nothing
}.bindenv(this));
imp.wakeup(0, function() {
for (local i = 0; i < numberOfRequests; i++) {
local req = http.request("GET", http.agenturl() + "/test", {}, "body");
req.sendasync(function(res) {
server.log("Response #" + (++count) + " | statuscode=" + res.statuscode);
}.bindenv(this));
}
}.bindenv(this));
imp.wakeup(2, function() {
Rocky.sendToAll(200, {"message": "OK"});
imp.wakeup(2, function() {
server.log("Total responses: " + count + "/" + numberOfRequests);
}.bindenv(this));
}.bindenv(this));Log:
[Agent] Response #1 | statuscode=200
[Agent] Response #2 | statuscode=200
[Agent] Response #3 | statuscode=200
[Agent] Response #4 | statuscode=200
[Agent] Total responses: 4/6
[Agent] Response #5 | statuscode=500
[Agent] Response #6 | statuscode=500
Tests:
This issue affects class: tests/AsyncRequests.agent.test.nut method: testMultipleAsyncRequestsWithSendToAll()
Metadata
Metadata
Assignees
Labels
No labels