如何为所有特征文件请求调用 Gatling successfulRequests 断言

How to Invoke Gatling successfulRequests Assert for All Feature File Requests

对于我的性能测试,由于没有后续请求所需的关联数据,很少数量的请求导致功能文件断言失败。在我的 scala 文件中,我有:

global.successfulRequests.percent.is(99)

但似乎功能文件断言仍需要 100% 成功:

> classpath:tests/sites/get_sites.feature:15 match $.data == '#[     58 (100.0%) _ > 0]'

失败的功能断言是:

And match $.data == '#[_ > 0]'

所以我通过将全局断言更改为以下内容来解决此问题:

global.successfulRequests.percent.gt(99)

虽然,仍然不确定为什么我在 Jenkins 中得到控制台输出..