discover/TEST.md

18 lines
841 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Test Report
## 测试场景
1. **基础发现与调用**: 验证服务启动后能自动注册到 Redis并能通过 Caller 正确发起请求。
2. **实时同步**: 验证通过 Redis PUBLISH 更新节点信息后,客户端能实时感知并更新本地节点列表。
3. **故障剔除**: 验证当节点调用持续失败时,能自动从本地列表中剔除。
4. **环境变量配置**: 验证 `EasyStart` 结合环境变量的启动流程。
5. **高效日志记录**: 验证 `DiscoverLog` 通过对象池和 `FillBase` 机制实现的高性能异步日志。
## 测试结果
- **Unit Tests**: `go test -v ./...`
- `TestDiscover`: PASS
- `TestEasyStart`: PASS
## Benchmark
- `BenchmarkDiscover`: ~560 ns/op (Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz)
- 负载均衡选择节点耗时极低,适合高并发场景。