1

我正在尝试ChaosMonkey参加我的弹性测试。我正在使用Spring BootWebTestClientClass 在黄瓜功能弹性测试中发出 api 请求。响应显示 Chaos Monkey 延迟配置正确,但我没有看到任何延迟。有谁知道为什么它不适用于我的测试?

我的观察者配置(来自测试的请求):

{
    "controller": false,
    "restController": false,
    "service": false,
    "repository": false,
    "component": false,
    "restTemplate": false,
    "webClient": false,
    "actuatorHealth": false,
    "beans": []
}

我的攻击配置(来自测试的请求):

{
    "level":1,
    "latencyRangeStart":5000,
    "latencyRangeEnd":5000,
    "latencyActive":true,
    "watchedCustomServices":["com.my.correct.repository.ClassName"]
}

我的application-test.properties文件与我的文件匹配application-dev.properties,它可以工作。

spring.profiles.include=resilience4J-test,chaos-monkey
server.error.include-message=always

chaos.monkey.enabled=true

management.endpoint.chaosmonkey.enabled=true
management.endpoint.chaosmonkeyjmx.enabled=true
management.endpoints.web.exposure.include=health,info,chaosmonkey
management.endpoint.health.show-details=always
management.health.circuitbreakers.enabled=true
management.endpoint.circuitbreakers.enabled=true

我正在使用Chaos Monkey 2.5.4Spring Boot 2.3.12

4

1 回答 1

0

实际上我刚刚发现您需要将 @ComponentScan 添加到测试应用程序中,以便 Chaos Monkey 可以发现组件和注释。它现在对我来说很好。

于 2022-01-15T06:59:10.123 回答