JMeter - 在忽略使用的行的同时恢复 CSV 驱动的执行

JMeter - Resume CSV driven execution while ignoring rows used

我 运行 并行 有时使用 ./shutdown.sh 立即停止测试,它按预期工作,

我想恢复执行的问题不包括已经 used/read

的 CSV records/rows

有没有办法读取 CSV 并将记录标记为已执行,以便在 resume/re-run 时忽略它?

我可以选择使用行号创建和更新不同的文件并签入脚本吗?

行为良好的测试需要 repeatable and ideally should leave the system in the same state as the before test, JMeter provides setUp and tearDown 线程组来实现预测试和 post 测试逻辑。因此,也许值得重新考虑如何使用测试数据并实现测试可重复性的方式?


回到你的问题:当你 运行 JMeter 每次都是一个不同的独立 Java 进程,它对以前的执行一无所知。

最简单的解决方案是切换到 HTTP Simple Table Server which has KEEP=FALSE parameter so you will use the data only once or to Redis DataSet Config,您还可以在其中删除已读取的数据。


普通的 JMeter 解决方案将使用 Sample Variables or into a separate file using Flexible File Writer 将上一次测试期间使用的数据写入 .jtl 结果文件,以便在下次执行之前可以从原始 CSV 文件中删除这些数据。