Testing webhooks

My question is pretty much this: Check for a request made to another endpoint · Issue #718 · grafana/k6 · GitHub

The main differences are that I am trying to load test a Microsoft Bot Framework-based chatbot and that replies with 200 when it has processed the incoming message, rather than immediately after receiving it, but conceptually it’s the exact same thing.

From the point of view of the load test, I am impersonating a user talking to the bot. Alongside testig the performance of the bot (how fast it replies), I also want to make sure that it replies with the correct answer for a given question under heavy load. To do this, the flow looks like this:

  1. I POST a request to the bot’s endpoint, passing the webhook URL of my local webserver (running on the same machine I run the load tests from) in the request’s body alongside the user’s message.

  2. The bot processes the incoming message, creates one or more replies, then sends one or more POST requests, each containing a separate reply, to the webhook URL received in step 1.

  3. The bot responds to the POST request received in step 1 with 200, signaling that it has finished processing the user’s message.

So as part of the load tests, I have to verify not just that the bot replies with 200 at the end, when it finished processing the incoming message and replied to it, but I also want to validate the content of it’s replies (what it sends back to my local webserver’s endpoint as POST requests before replying with 200 to my own request) to see if it answered correctly.

How can I load test such a scenario with k6?

Currently I am using JMeter and this plugin to do this.

Hi @peterbozso, welcome to the community forum and sorry for the slow response.

There has been no change. You will need to:

  1. have an http server running in k6, which is currently not supported and will likely need async/await support. But I guess you can use the very new and experimental extensions support in k6 through xk6 and write an extension in golang to do that. I have no idea what the API for that needs to look like, but arguably you can hardcode your needs in the golang extensions :man_shrugging:. List of other extensions as examples as the documentation is a WIP.
  2. Have your server where the endpoint is have another endpoint that you can poll or something to check that everything went okay.

I hope this helps you