https://bz.apache.org/bugzilla/show_bug.cgi?id=65034

            Bug ID: 65034
           Summary: BinaryTCPClientImpl doesnt skip EOL byte check even
                    when it is set to skip
           Product: JMeter
           Version: 5.4
          Hardware: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Main
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: JMETER 5.4.1

We have TCP sampler requests generated for one of our application in Unisys.
the requests sends few bits of data and receive few bits of data (application
sends back different response for same request). We had no issue while runnung
the same on JMeter 2.5.1 but recently we moved all our scripts to JMeter 5.4
and all our TCP requests are failing. the cause to this what we identified
after a thorough testing was that the EOL byte field which needs to be set if
we know the response else we can leave it blank as "BinaryTCPClientImpl" class
will take 1000 as default which sets the flag to not to check EOL but in
reality this is not working. We tried our samples from JMeter initial version
where EOL was introduced. From there till 5.4 we saw the same issue. 
Below is the snippet from the src for "BinaryTCPClientImpl". The issue what we
are suspecting is the last "IF" statement which is not working as expected.
We also verified running JMeter 5.4 and wireshark on our samplers to make sure
if we are sending and receiving data and it looks that JMeter is receiving the
data but fails the script in the final stage during EOL check. Please let us
know if there is a workaround or anything we are missing out from our
observation.

   /**
     * Reads data until the defined EOM byte is reached.
     * If there is no EOM byte defined, then reads until
     * the end of the stream is reached.
     * Response data is converted to hex-encoded binary
     * @return hex-encoded binary string
     * @throws ReadException when reading fails
     */
    @Override
    public String read(InputStream is, SampleResult sampleResult) throws
ReadException {
        ByteArrayOutputStream w = new ByteArrayOutputStream();
        try {
            byte[] buffer = new byte[4096];
            int x = 0;
            boolean first = true;
            while ((x = is.read(buffer)) > -1) {
                if (first) {
                    sampleResult.latencyEnd();
                    first = false;
                }
                w.write(buffer, 0, x);
                if (useEolByte && (buffer[x - 1] == eolByte)) {
                    break;
                }
            }

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to