Commit 3ad3adc
committed
Indexing: Add concurrency stress tests
- Add `stress_tests.rs` with 5 tests exercising concurrent actors against real SQLite: scan + buffered event replay, concurrent batch inserts from 4 threads, scan + enrichment reads via `ReadPool`, live event storm + concurrent reads, and lifecycle transitions (shutdown with pending writes, rapid restart, double shutdown)
- Shared test helpers: `build_synthetic_tree` (generates valid `EntryRow` trees), `check_db_consistency` (verifies 5 DB invariants: no orphans, all dirs have `dir_stats`, recursive stats correct, no duplicate keys)
- No production code changes — tests use existing seams (`WriteMessage` channel, `ReadPool`, `EventReconciler`)1 parent 50bd4fa commit 3ad3adc
3 files changed
Lines changed: 1058 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
1045 | 1048 | | |
1046 | 1049 | | |
1047 | 1050 | | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
1054 | 1056 | | |
1055 | | - | |
1056 | | - | |
| 1057 | + | |
| 1058 | + | |
1057 | 1059 | | |
1058 | 1060 | | |
1059 | 1061 | | |
| |||
1074 | 1076 | | |
1075 | 1077 | | |
1076 | 1078 | | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
| 1079 | + | |
1080 | 1080 | | |
1081 | 1081 | | |
1082 | 1082 | | |
| |||
0 commit comments