Optimized slow tests by reducing unnecessary network timeouts and retry delays: **PagerDuty tests (7.3s → 0.2s, 97% faster):** - Added test-specific sleep/backoff configuration - Use 1ms sleep instead of 1s/2s/4s exponential backoff in tests - Maintains retry logic for production, fast tests in dev **HTTP/UISP client tests (7s → <0.1s, 99% faster):** - Disabled Req retry middleware in test environment - Added 1s receive_timeout for test requests - Prevents 7s retry delays on error status codes **Ping executor tests (13s → 1.5s, 88% faster per test):** - Reduced ping timeout from 6-10s to 0.5-1s for localhost - Reduced timeout to 1s for unreachable hosts - Still validates behavior, just faster **Changes:** - lib/towerops/pagerduty/client.ex: test-aware sleep/backoff - lib/towerops/http.ex: disable retry in tests, 1s timeout - lib/towerops/uisp/client.ex: disable retry in tests, 1s timeout - test/towerops/monitoring/executors/ping_executor_test.exs: reduced timeouts **Result:** Total test time: 118.4s → 65.3s (45% improvement) Top 10 slowest: 66.1s → 10.9s (83% improvement) Reviewed-on: graham/towerops-web#126 |
||
|---|---|---|
| .. | ||
| mix/tasks | ||
| snmpkit | ||
| towerops | ||
| towerops_web | ||
| snmp_lib.ex | ||
| snmp_mgr.ex | ||
| snmpkit.ex | ||
| towerops.ex | ||
| towerops_native.ex | ||
| towerops_web.ex | ||