Jmeter cleanup/ force not to abort before completely executing a group [closed]

左心房为你撑大大i 提交于 2020-01-06 20:19:20

问题


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?


回答1:


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."



来源:https://stackoverflow.com/questions/35213636/jmeter-cleanup-force-not-to-abort-before-completely-executing-a-group

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!