File: configs/scenarios/enhanced/regression-test.yml
Version: 1.0
Tags: regression, ci-cd, short, quick, automated
Fast CI/CD regression test optimized for detecting performance degradation in automated pipelines. This scenario provides meaningful performance metrics in just 2 minutes, making it ideal for pull request validation and continuous integration workflows.
- Continuous integration pipelines - Run on every PR or commit
- Pre-commit hooks - Quick validation before pushing code
- Pull request validation - Ensure changes don't degrade performance
- Quick smoke tests - Fast verification that system is working
- Development iteration - Rapid feedback during feature development
| Parameter | Value | Description |
|---|---|---|
| Duration | 120 seconds (2 min) | Fast but meaningful test duration |
| Traders | 10 | Moderate concurrency level |
| Expected Orders | ~600 | Total orders over test duration |
| Trading Pattern | constant_rate | Predictable, consistent load |
| Base Rate | 300.0 orders/min | 5 orders/second aggregate rate |
- Market Orders: 50%
- Limit Orders: 50%
- TWAP Orders: 0%
- Stop-Loss Orders: 0%
- Good-After-Time Orders: 0%
Rationale: Balanced mix of market and limit orders provides comprehensive testing without complexity of conditional orders.
Minimum:
- Memory: 2.0 GB
- CPU Cores: 2
Recommended:
- Memory: 4.0 GB
- CPU Cores: 4
The test automatically validates results against these thresholds:
| Metric | Threshold | Rationale |
|---|---|---|
| Success Rate | ≥ 90% | Allows for some liquidity issues while catching major problems |
| P95 Latency | ≤ 15 seconds | Reasonable latency for CI environment |
| Error Rate | ≤ 10% | Tolerates minor errors but catches systemic issues |
| Throughput | ≥ 4.0 orders/sec | Ensures system can handle expected load |
With healthy system performance, you should see:
- Success rate: 93-98%
- P95 latency: 8-12 seconds
- Error rate: 2-5%
- Throughput: 4.5-5.5 orders/second
- Most orders settle within 1-2 auction rounds
Watch for these warning signs:
- Success rate < 90% → Solver issues or liquidity problems
- P95 latency > 15s → System overload or network issues
- Error rate > 10% → API problems or validation failures
- Throughput < 4.0 orders/sec → Rate limiting or bottlenecks
# Run regression test with default config
cow-perf run --config configs/scenarios/enhanced/regression-test.yml
# Run and save as baseline
cow-perf run \
--config configs/scenarios/enhanced/regression-test.yml \
--save-baseline "pr-123" \
--baseline-description "Performance before optimization"
# Run with custom settlement wait
cow-perf run \
--config configs/scenarios/enhanced/regression-test.yml \
--settlement-wait 180from pathlib import Path
from cow_performance.cli.commands.scenarios import load_scenario_from_yaml
from cow_performance.scenarios import SuccessCriteriaValidator
# Load scenario
scenario = load_scenario_from_yaml(
Path('configs/scenarios/enhanced/regression-test.yml')
)
# Run test (implementation specific)
results = run_performance_test(scenario)
# Validate results
validator = SuccessCriteriaValidator(scenario.success_criteria)
validation = validator.validate_from_dict(results)
if not validation.passed:
print(f"❌ Regression detected: {len(validation.failures)} failures")
for failure in validation.failures:
print(f" - {failure.message}")
exit(1)
else:
print("✅ Performance within acceptable thresholds")name: Performance Regression Test
on: [pull_request]
jobs:
regression-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup environment
run: |
# Setup steps...
- name: Run regression test
run: |
cow-perf run \
--config configs/scenarios/enhanced/regression-test.yml \
--save-baseline "pr-${{ github.event.pull_request.number }}"
- name: Check for regressions
run: |
# Compare against main branch baseline
cow-perf compare \
--baseline main \
--current "pr-${{ github.event.pull_request.number }}"-
Success Rate - Primary health indicator
-
95%: Excellent
- 90-95%: Acceptable
- < 90%: Investigation required
-
-
P95 Latency - Performance consistency
- < 10s: Excellent
- 10-15s: Acceptable
-
15s: Performance issue
-
Error Rate - System stability
- < 5%: Excellent
- 5-10%: Acceptable
-
10%: Stability issue
-
Throughput - System capacity
-
5 orders/s: Excellent
- 4-5 orders/s: Acceptable
- < 4 orders/s: Capacity issue
-
Low Success Rate
- Check solver availability and health
- Verify liquidity on test tokens
- Review API error logs
High Latency
- Check network connectivity
- Monitor auction frequency
- Review solver processing time
High Error Rate
- Check API response codes
- Verify order validation
- Review authentication issues
Low Throughput
- Check rate limiting
- Monitor system resources
- Review trader orchestration
- Run on every PR - Catch regressions early
- Save baselines - Track performance over time
- Set up alerts - Get notified when thresholds are breached
- Compare to baseline - Detect relative performance changes
- Run in consistent environment - Use same hardware/network for comparisons
- Review trends - Watch for gradual degradation over time
- sustained-load.yml - For longer stability testing (30 min)
- high-frequency.yml - For extreme load testing (100 orders/sec)
- large-orders.yml - For whale trader edge cases
Test times out
- Increase
durationor reducenum_traders - Check if services are running
All orders fail
- Verify API connectivity
- Check solver availability
- Ensure wallets have funds
Inconsistent results
- Run multiple times to establish baseline
- Check for external factors (network, solver load)
- Ensure consistent environment
- 1.0 (Initial) - Fast 2-minute regression test optimized for CI/CD