Hi,

I have interesting use case in which the value of a given variable has to be
compared across threads. I will try my best to illustrate it below.

TestPlan
+ThreadGroup ( 5threads, 2loops)
++Http sampler 1 (This  sampler  will fetch all the requests that are
waiting for approval)
+++ BSF Post Processor 1
++ Http Sampler 2 (The sampler sends the request id which has to be
approved)
+++ BSF Post Processor 2

The response of Http sampler 1 will contain a list of ids of the requests to
be approved. I'm fetching the first request id and sending it as a parameter
to Http Sampler 2 for approval.

The problem occurs when the 1st thread has picked a certain request id (say
request id 1101) and send it as a parameter to Http Sampler 2 for approval,
but before this request has been approved the second thread gets active and
send a http request (Http Sampler 1) and receives all the request ids to be
approved as a response, therefore the second thread also sees request id
1101 (Since it has not been approved yet) and picks it up for approval i.e.
the same request id is passed to Http Sampler 2 for second thread also.  Now
there is clash of multiple threads trying to approve the same request and
the server responds with an error.



So my question is, how do I ensure different threads pick different request
id (i.e one that is not picked up by any of the other active threads)??



Please let me know if I have to make it more clearer.



Thanks,

Prasanna

Reply via email to