artilleryio / artillery-core

artillery-core - deprecated
Mozilla Public License 2.0
29 stars 104 forks source link

Add socketio query configuration #150

Closed n3ps closed 7 years ago

n3ps commented 7 years ago

To add support for passing in query (handshake) information to a socketio-based test

n3ps commented 7 years ago

Usage will be similar to adding transport configuration:

config:
  socketio:
    query: "param=value"
hassy commented 7 years ago

Nice, thanks @n3ps!

BerendWeij commented 7 years ago

@n3ps can you check this issue: https://github.com/shoreditch-ops/artillery-core/issues/165

You are adding the query object to the options in the method loadContextSocket but not in the compile method. I guess both methods are being triggered which results in two connections with socket.io. This results in two bugs:

n3ps commented 7 years ago

@BerendWeij, @hassy I see the two connections bug and I don't think this commit introduced that as I reproduced it in an older version (artillery@1.5.2, artillery-core@2.4.1).

Re: the compile method not having query in options, I'll update that.

MaxOvcharov commented 7 years ago

Hi, I'm using artillery@1.6.0-6. I want to put my query parameters into Socket.io connection:

  target: "http://127.0.0.1:8080"
  phases:
    - duration: 28800
      arrivalRate: 50
  variables:
    var: ['1', '2']
  processor: "./functions.js"
  socketio:
    transports: ["websocket"]
    query: "user_id=4f5bc00e-8516-49a9-8507-d475d40d06b5"

But after artillery is running my server have no message from artillery. Does this a correct way to using "query" parameter?

MaxOvcharov commented 7 years ago

@n3ps Can you help me?

hassy commented 7 years ago

@MaxOvcharov Do you have a reproducible test case? query isn't known to be broken at the moment. If you do, could you open a new issue on the main repo please.

MaxOvcharov commented 7 years ago

@hassy Done https://github.com/shoreditch-ops/artillery-core/issues/195