Git Product home page Git Product logo

Comments (13)

tahsintahsin avatar tahsintahsin commented on September 12, 2024

have the same problem

from jmeter-websocketsampler.

ehteshamy2k avatar ehteshamy2k commented on September 12, 2024

I am experiencing same problem. Any pointers would be helpful please

from jmeter-websocketsampler.

gauravmehta11 avatar gauravmehta11 commented on September 12, 2024

Same issue also not able to provide a loop to generate unique Websocket connections anyone can help?

from jmeter-websocketsampler.

peer2peer avatar peer2peer commented on September 12, 2024

Same issue when I run a thread group with thread numbers larger than 1. Any existing solution to fix it?

from jmeter-websocketsampler.

peer2peer avatar peer2peer commented on September 12, 2024

When I track in the code, I see that the session is null actually (session.getRemote().sendString(message); ) and before that, onOpen method wasn't called.

from jmeter-websocketsampler.

ceritandogan avatar ceritandogan commented on September 12, 2024

Hello,

I amd using SignalR of Microsoft and I had the same issue: I digged into problem by using wireshark. I found out that Server was returning "http 500".
On my side, Solution for this:
Encode Token and ConnectionToken on jmeter.

Then next problem appeared: "Http 400" occured.
I found another problem java.net.URI.
The code in WebSocketSampler.java is like this:
URI uri = new URI(protocol, null, domain, -1, path , queryString, null);
ın this case querystring was encoded 2 times so the connectiontoken was encoded 2 times, therefore, Server can not understand connectiontoken so it returns HTTP 400.
So I fixed the code like this:
URI uri = new URI(protocol, null, domain, -1, path + "?" + queryString, null, null);

And Recompiled and installed with maven and put it in Jmeter.
Now It is working on my side quite well.

I hope it will help.

Cheers,

from jmeter-websocketsampler.

peer2peer avatar peer2peer commented on September 12, 2024

Hi,

I cannot find the source code in WebSocketSampler.java:
URI uri = new URI(protocol, null, domain, -1, path , queryString, null);

Could you give more detailed info?
Thanks.

from jmeter-websocketsampler.

ceritandogan avatar ceritandogan commented on September 12, 2024

https://github.com/maciejzaleski/JMeter-WebSocketSampler/archive/version-1.0.2.zip
src\main\java\JMeter\plugins\functional\samplers\websocket\WebSocketSampler.java
Line 228
Line 230

from jmeter-websocketsampler.

peer2peer avatar peer2peer commented on September 12, 2024

ceritandogan, Got it, thanks!

The problem is eased but not fixed completely yet.
Could you give the code fix details? Thanks!

My problem is when I run a thread group with thread number of n (n > 1), all the thread will failed to connect to the server except the last one always succeed.
Now with the fix, When n = 3, I got the last 2 threads succeed to connect to the server except the first one.

My fix done as ceritandogan gave:

        if (isProtocolDefaultPort()) {
//            return new URI(protocol, null, domain, -1, path, queryString, null);
        return new URI(protocol, null, domain, -1, path + "?" + queryString, null, null);
        }
//        return new URI(protocol, null, domain, Integer.parseInt(getServerPort()), path, queryString, null);
        return new URI(protocol, null, domain, Integer.parseInt(getServerPort()), path + "?" + queryString, null, null);

Also, I instrumented logs in WebSocket.java as below:

public void sendMessage(String message) throws IOException {
        if (session != null){
            logMessage.append(" - Session not null! JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage!").append("\n");
        } else {
            logMessage.append(" - Session null! JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage!").append("\n"); 
        }
        if (session.getRemote() != null)
            logMessage.append(" - session.getRemote not null! JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage!").append("\n");

        if (message != null)
            logMessage.append(" - ").append(message).append(" - mssage! JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage!").append("\n");

        session.getRemote().sendString(message);
    }

The failed thread's sampler results:

[Execution Flow]

  • Opening new connection
  • Using response message pattern ""
  • Using disconnect pattern ""
  • Waiting for the server connection for 5000 MILLISECONDS
  • Cannot connect to the remote server
  • Session null! JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage!

[Problems]

  • Unexpected error: null
    JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage(ServiceSocket.java:156) >JMeter.plugins.functional.samplers.websocket.WebSocketSampler.sample(WebSocketSampler.java:136) org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434) >org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261) java.lang.Thread.run(Unknown Source)

The code line numbers in the output are those of the origin source code before I changed any code.

The sampler results show that the session here is Null for the failed user. (- Session null! JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage!)

Any ideas?

from jmeter-websocketsampler.

conwilly88 avatar conwilly88 commented on September 12, 2024

@peer2peer I updated jetty to use version 9.3.9.M1 and I am no longer getting this error.

from jmeter-websocketsampler.

x00350069 avatar x00350069 commented on September 12, 2024

@peer2peer ,I also have this problem,Could you tell me how to solve this problem or giving me your JMeterWebSocketSampler-1.0.2-SNAPSHOT.jar which you have modified.Thanks~~~~

Thread Name: Thread Group 1-1
Sample Start: 2015-04-20 13:18:38 EDT
Load time: 5010
Connect Time: 0
Latency: 0
Size in bytes: 0
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Response code:
Response message:

[Execution Flow]

Opening new connection
Using response message pattern ""
Using disconnect pattern ""
Waiting for the server connection for 5000 MILLISECONDS
Cannot connect to the remote server
[Variables]

Message count: 0
[Problems]

Unexpected error: null JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage(ServiceSocket.java:147) JMeter.plugins.functional.samplers.websocket.WebSocketSampler.sample(WebSocketSampler.java:116) org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434) org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261) java.lang.Thread.run(Unknown Source)
Response headers:

SampleResult fields:
ContentType:
DataEncoding: UTF-8

from jmeter-websocketsampler.

4M01 avatar 4M01 commented on September 12, 2024

@peer2peer, @conwilly88 & @x00350069 I have updated dependency to mentioned jar files, still facing the issue. Can you guys point me to right direction?

from jmeter-websocketsampler.

luisxiaomai avatar luisxiaomai commented on September 12, 2024

I also met this issue, @peer2peer, @conwilly88 & @x00350069 can you share a fixed jar file? Thanks.

from jmeter-websocketsampler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.