You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/chaos/README.md
+121-2Lines changed: 121 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,9 @@ go test -v ./test/chaos/...
53
53
54
54
# Scenario 6: Slow Close Connections (Slicer)
55
55
./test/chaos/run_scenario_06.sh
56
+
57
+
# Scenario 7: Combined Failures (DB + Kafka)
58
+
./test/chaos/run_scenario_07.sh
56
59
```
57
60
58
61
The helper scripts will:
@@ -82,6 +85,9 @@ go test -v ./test/chaos -run TestScenario05
82
85
83
86
# Scenario 6: Slow Close Connections (Slicer)
84
87
go test -v ./test/chaos -run TestScenario06
88
+
89
+
# Scenario 7: Combined Failures (DB + Kafka)
90
+
go test -v ./test/chaos -run TestScenario07
85
91
```
86
92
87
93
### Run in Verbose Mode
@@ -409,6 +415,116 @@ go test -v ./test/chaos -run TestScenario06_KafkaSlowClose
409
415
410
416
**Combined scenario duration:**~55 seconds
411
417
418
+
### Scenario 7: Combined Failures (3 variants)
419
+
**File:**`scenario_07_combined_failures_test.go`
420
+
421
+
Tests system behavior when multiple dependencies fail simultaneously or in sequence. This simulates realistic infrastructure-wide issues like datacenter problems, network partitions, or cascading failures.
422
+
423
+
#### Variant A: Simultaneous Complete Failure
424
+
**Test:**`TestScenario07_SimultaneousFailure`
425
+
426
+
**What it tests:**
427
+
- System behavior when both PostgreSQL AND Kafka fail at the same time
428
+
- Failure detection when multiple dependencies down
429
+
- Graceful degradation (errors, not crashes)
430
+
- Simultaneous recovery of both services
431
+
- Data consistency after dual failure
432
+
433
+
**How to run:**
434
+
```bash
435
+
# Using helper script
436
+
./test/chaos/run_scenario_07.sh
437
+
438
+
# Using go test directly
439
+
go test -v ./test/chaos -run TestScenario07_SimultaneousFailure
440
+
```
441
+
442
+
**Test phases:**
443
+
1. Establish baseline with both services healthy
444
+
2. Disable both PostgreSQL and Kafka simultaneously (complete failure)
445
+
3. Test behavior during simultaneous outage
446
+
4. Restore both services simultaneously
447
+
5. Verify recovery and data consistency
448
+
449
+
**Expected results:**
450
+
- ✅ Baseline: Both services healthy and functional
451
+
- ✅ Simultaneous failure: Both fail quickly and cleanly (no hangs)
452
+
- ✅ During outage: Errors returned promptly (not timeouts or crashes)
453
+
- ✅ Recovery: Both services restored successfully
454
+
- ✅ Consistency: No data corruption from dual failure
455
+
456
+
**Test duration:**~10 seconds
457
+
458
+
#### Variant B: Simultaneous Latency
459
+
**Test:**`TestScenario07_SimultaneousLatency`
460
+
461
+
**What it tests:**
462
+
- System behavior when both PostgreSQL AND Kafka become slow simultaneously
463
+
- Performance degradation when multiple dependencies affected
464
+
- System remains functional despite infrastructure-wide slowdown
465
+
- Recovery when latency removed from both
466
+
467
+
**How to run:**
468
+
```bash
469
+
# Using helper script
470
+
./test/chaos/run_scenario_07.sh
471
+
472
+
# Using go test directly
473
+
go test -v ./test/chaos -run TestScenario07_SimultaneousLatency
0 commit comments