Documentation ¶
Index ¶
- func CheckInstanceAvailable(c *check.C, consumerAPI api.ConsumerAPI, targetIns model.Instance, ...)
- func Logic(c *check.C, tcpServer func(string, int, []byte) error, ...)
- type CircuitBreakSuite
- func (t *CircuitBreakSuite) GetName() string
- func (t *CircuitBreakSuite) SetUpSuite(c *check.C)
- func (t *CircuitBreakSuite) TearDownSuite(c *check.C)
- func (t *CircuitBreakSuite) TestAllCircuitBreaker(c *check.C)
- func (t *CircuitBreakSuite) TestAllHalfOpenReturn(c *check.C)
- func (t *CircuitBreakSuite) TestCircuitBreakByDefault(c *check.C)
- func (t *CircuitBreakSuite) TestErrCount(c *check.C)
- func (t *CircuitBreakSuite) TestErrCountByGetInstances(c *check.C)
- func (t *CircuitBreakSuite) TestErrCountTriggerOpenThreshold(c *check.C)
- func (t *CircuitBreakSuite) TestErrRate(c *check.C)
- func (t *CircuitBreakSuite) TestErrRateByGetInstances(c *check.C)
- func (t *CircuitBreakSuite) TestErrRateTriggerOpenThreshold(c *check.C)
- func (t *CircuitBreakSuite) TestHalfOpenMustChangeErrorCount(c *check.C)
- func (t *CircuitBreakSuite) TestHalfOpenSlow(c *check.C)
- func (t *CircuitBreakSuite) TestSleepWindow(c *check.C)
- func (t *CircuitBreakSuite) TestWhenOpenToHalfOpenChangToIsolate(c *check.C)
- func (t *CircuitBreakSuite) TestWhenOpenToHalfOpenChangToUnhealthy(c *check.C)
- func (t *CircuitBreakSuite) TestWhenOpenToHalfOpenChangToWeightZero(c *check.C)
- func (t *CircuitBreakSuite) WhenOpenToHalfOpenChangToUnavailable(c *check.C, flag int)
- type HealthCheckAlwaysTestingSuite
- type HealthCheckTestingSuite
- func (t *HealthCheckTestingSuite) GetName() string
- func (t *HealthCheckTestingSuite) SetUpSuite(c *check.C)
- func (t *HealthCheckTestingSuite) TearDownSuite(c *check.C)
- func (t *HealthCheckTestingSuite) TestFailHTTPDetection(c *check.C)
- func (t *HealthCheckTestingSuite) TestFailTCPDetection(c *check.C)
- func (t *HealthCheckTestingSuite) TestHTTPDetection(c *check.C)
- func (t *HealthCheckTestingSuite) TestTCPDetection(c *check.C)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckInstanceAvailable ¶
func CheckInstanceAvailable(c *check.C, consumerAPI api.ConsumerAPI, targetIns model.Instance, available bool, namespace string, service string)
CheckInstanceAvailable 检查实例是否可用
Types ¶
type CircuitBreakSuite ¶
type CircuitBreakSuite struct {
// contains filtered or unexported fields
}
CircuitBreakSuite 熔断测试套件
func (*CircuitBreakSuite) SetUpSuite ¶
func (t *CircuitBreakSuite) SetUpSuite(c *check.C)
SetUpSuite 初始化套件
func (*CircuitBreakSuite) TearDownSuite ¶
func (t *CircuitBreakSuite) TearDownSuite(c *check.C)
TearDownSuite 销毁套件
func (*CircuitBreakSuite) TestAllCircuitBreaker ¶
func (t *CircuitBreakSuite) TestAllCircuitBreaker(c *check.C)
TestAllCircuitBreaker 测试所有熔断器 全部熔断后测试 全部熔断后优先获取熔断实例 全部不健康,可以触发全死全活
func (*CircuitBreakSuite) TestAllHalfOpenReturn ¶
func (t *CircuitBreakSuite) TestAllHalfOpenReturn(c *check.C)
TestAllHalfOpenReturn 断开熔断变更错误率
func (*CircuitBreakSuite) TestCircuitBreakByDefault ¶
func (t *CircuitBreakSuite) TestCircuitBreakByDefault(c *check.C)
TestCircuitBreakByDefault 通过默认配置来进行熔断测试
func (*CircuitBreakSuite) TestErrCount ¶
func (t *CircuitBreakSuite) TestErrCount(c *check.C)
TestErrCount 测试利用err_Count熔断器熔断实例
func (*CircuitBreakSuite) TestErrCountByGetInstances ¶
func (t *CircuitBreakSuite) TestErrCountByGetInstances(c *check.C)
TestErrCountByGetInstances 测试通过获取多个实例接口分配的实例也可以进行连续错误数熔断半开状态转换
func (*CircuitBreakSuite) TestErrCountTriggerOpenThreshold ¶
func (t *CircuitBreakSuite) TestErrCountTriggerOpenThreshold(c *check.C)
TestErrCountTriggerOpenThreshold 连续错误熔断的阈值 测试
func (*CircuitBreakSuite) TestErrRate ¶
func (t *CircuitBreakSuite) TestErrRate(c *check.C)
TestErrRate 测试利用err_rate熔断器熔断实例
func (*CircuitBreakSuite) TestErrRateByGetInstances ¶
func (t *CircuitBreakSuite) TestErrRateByGetInstances(c *check.C)
TestErrRateByGetInstances 测试通过获取多个实例接口分配的实例也可以进行错误率熔断半开状态转换
func (*CircuitBreakSuite) TestErrRateTriggerOpenThreshold ¶
func (t *CircuitBreakSuite) TestErrRateTriggerOpenThreshold(c *check.C)
TestErrRateTriggerOpenThreshold 触发错误率熔断的阈值 测试
func (*CircuitBreakSuite) TestHalfOpenMustChangeErrorCount ¶
func (t *CircuitBreakSuite) TestHalfOpenMustChangeErrorCount(c *check.C)
TestHalfOpenMustChangeErrorCount 断开熔断变更错误
func (*CircuitBreakSuite) TestHalfOpenSlow ¶
func (t *CircuitBreakSuite) TestHalfOpenSlow(c *check.C)
TestHalfOpenSlow 半开后低频率请求测试
func (*CircuitBreakSuite) TestSleepWindow ¶
func (t *CircuitBreakSuite) TestSleepWindow(c *check.C)
TestSleepWindow 设置熔断器的睡眠窗口 测试 熔断sleepWindow测试, 不启用探测 测试半开后最大可以获取实例的次数 熔断器半开后恢复所需成功探测数测试
func (*CircuitBreakSuite) TestWhenOpenToHalfOpenChangToIsolate ¶
func (t *CircuitBreakSuite) TestWhenOpenToHalfOpenChangToIsolate(c *check.C)
TestWhenOpenToHalfOpenChangToIsolate 当熔断开后,熔断状态变为半开后,熔断状态变为不可用
func (*CircuitBreakSuite) TestWhenOpenToHalfOpenChangToUnhealthy ¶
func (t *CircuitBreakSuite) TestWhenOpenToHalfOpenChangToUnhealthy(c *check.C)
TestWhenOpenToHalfOpenChangToUnhealthy 当熔断开后,熔断状态变为半开后,熔断状态变为不可用
func (*CircuitBreakSuite) TestWhenOpenToHalfOpenChangToWeightZero ¶
func (t *CircuitBreakSuite) TestWhenOpenToHalfOpenChangToWeightZero(c *check.C)
TestWhenOpenToHalfOpenChangToWeightZero 当熔断开后,熔断状态变为半开后,熔断权重为0
func (*CircuitBreakSuite) WhenOpenToHalfOpenChangToUnavailable ¶
func (t *CircuitBreakSuite) WhenOpenToHalfOpenChangToUnavailable(c *check.C, flag int)
WhenOpenToHalfOpenChangToUnavailable 当熔断开后,熔断状态变为半开后,熔断状态变为不可用
type HealthCheckAlwaysTestingSuite ¶
type HealthCheckAlwaysTestingSuite struct {
// contains filtered or unexported fields
}
HealthCheckAlwaysTestingSuite 消费者API测试套
func (*HealthCheckAlwaysTestingSuite) GetName ¶
func (t *HealthCheckAlwaysTestingSuite) GetName() string
GetName 套件名字
func (*HealthCheckAlwaysTestingSuite) SetUpSuite ¶
func (t *HealthCheckAlwaysTestingSuite) SetUpSuite(c *check.C)
SetUpSuite 启动测试套程序
func (*HealthCheckAlwaysTestingSuite) TearDownSuite ¶
func (t *HealthCheckAlwaysTestingSuite) TearDownSuite(c *check.C)
TearDownSuite 结束测试套程序
func (*HealthCheckAlwaysTestingSuite) TestHttpDetectAlways ¶
func (t *HealthCheckAlwaysTestingSuite) TestHttpDetectAlways(c *check.C)
TestHttpDetectAlways 测试持久化探测
type HealthCheckTestingSuite ¶
type HealthCheckTestingSuite struct {
// contains filtered or unexported fields
}
HealthCheckTestingSuite 消费者API测试套
func (*HealthCheckTestingSuite) GetName ¶
func (t *HealthCheckTestingSuite) GetName() string
GetName 套件名字
func (*HealthCheckTestingSuite) SetUpSuite ¶
func (t *HealthCheckTestingSuite) SetUpSuite(c *check.C)
SetUpSuite 启动测试套程序
func (*HealthCheckTestingSuite) TearDownSuite ¶
func (t *HealthCheckTestingSuite) TearDownSuite(c *check.C)
TearDownSuite 结束测试套程序
func (*HealthCheckTestingSuite) TestFailHTTPDetection ¶
func (t *HealthCheckTestingSuite) TestFailHTTPDetection(c *check.C)
TestFailHTTPDetection 测试UDP探测失败
func (*HealthCheckTestingSuite) TestFailTCPDetection ¶
func (t *HealthCheckTestingSuite) TestFailTCPDetection(c *check.C)
TestFailTCPDetection 测试TCP探测失败
func (*HealthCheckTestingSuite) TestHTTPDetection ¶
func (t *HealthCheckTestingSuite) TestHTTPDetection(c *check.C)
TestHTTPDetection 测试HTTP健康探测
func (*HealthCheckTestingSuite) TestTCPDetection ¶
func (t *HealthCheckTestingSuite) TestTCPDetection(c *check.C)
TestTCPDetection 测试TCP健康探测