Jmeter清理/强制在完全执行组之前不中止 [英] Jmeter cleanup/ force not to abort before completely executing a group

查看:315
本文介绍了Jmeter清理/强制在完全执行组之前不中止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个jmeter脚本,其中包含5个请求的1组. 我需要此脚本永久运行,并将手动将其杀死. 当我手动将其杀死时,问题就来了,但是它只完成了两次任务,而没有完成3-5次.

例如:我正在执行CRUD测试.因此它创建了resurce,读取了recece,并且我终止了脚本或定时脚本自动终止了.删除将不会执行,并且会在我的数据库中留下额外的条目. 我该如何预防?

解决方案

只需将tearDown线程组添加到测试中,然后添加删除那里的资源的请求即可. 这是在帮助中描述此元素的方式:

"tearDown是一种特殊的ThreadGroup类型,可用于执行测试后操作.这些线程的行为与普通的Thread Group元素完全一样.不同之处在于,这些类型的线程在测试完成后执行执行其常规线程组.

请注意,如果默认情况下正常关闭了Test,则默认情况下它将不会运行,如果要在这种情况下使其运行,请确保选中Test Plan元素上的在关闭主线程后运行tearDown线程组"选项.如果测试计划"已停止,则即使选中该选项,tearDown也不会运行."

I have a jmeter script with 1 group containing 5 requests. I need this script to run forever and will kill it manually. the problem comes when i kill it manually but it has completed only two reuest and 3-5 are not done.

eg: i am performing CRUD test. So it has created resurce ,read the resurce and I terminated script or timed script got terminated automatically. The delete will not execute and it leaves extra entry in my database. How do I prevent it?

解决方案

Just add tearDown Thread Group to your test and add requests that delete your resources there. Here is how this element is described in help:

"tearDown is a special type of ThreadGroup that can be utilized to perform Post-Test Actions. The behavior of these threads is exactly like a normal Thread Group element. The difference is that these type of threads execute after the test has finished executing its regular Thread Groups.

Note that by default it won't run if Test is gracefully shutdown, if you want to make it run in this case, ensure you check option "Run tearDown Thread Groups after shutdown of main threads" on Test Plan element. If Test Plan is stopped, tearDown will not run even if option is checked."

这篇关于Jmeter清理/强制在完全执行组之前不中止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆