Philip Polyakov
Philip Polyakov

Reputation: 21

Is it possible to fail a sample in Jmeter if JDBC response time takes too long?

The problem is that some requests take a pair of seconds to answer and for others JMeter might wait forever. So I need to have a test plan in which if JDBC request response time crosses 30 sec for any of the sample, it should fail the sample, stop it and move on to the next sample.

How to make it work?

Upvotes: 2

Views: 441

Answers (3)

Dmitri T
Dmitri T

Reputation: 168197

Starting from JMeter 2.11 there is a possibility to specify query timeout in the JDBC Test Elements:

enter image description here

It is also possible to use Duration Assertion, however in this case JMeter will still wait for the query completion and only mark the sampler as failed after it's done.

Upvotes: 0

Ori Marko
Ori Marko

Reputation: 58882

Add Duration Assertion which will stop waiting more than 30 seconds, fail the sampler and move to next sampler as you need

Duration Assertion tests that each response was received within a given amount of time. Any response that takes longer than the given number of milliseconds (specified by the user) is marked as a failed response.

Upvotes: 1

krishnarajanr
krishnarajanr

Reputation: 696

You can set the Querytimeout in the JDBC Request sampler.

Check the screenshot belowenter image description here

Upvotes: 0

Related Questions