Commit 03439b9
fix(tests): share NLP engine across recognizer tests to prevent CI OOM
Each test was creating a new AnalyzerEngine with nlp_engine=None which
loaded en_core_web_lg (~700MB) once per test. 53 tests × 5s = 265s+
and accumulated memory caused GitHub Actions runner OOM kills.
Fix: module-level shared NLP engine loaded once per session.
Result: test_hipaa_recognizers.py 30s → 7.72s, no per-test spaCy load.
Also: PHI_REDACTOR_SPACY_MODEL env var wired into detection engine and
test helper so CI can use en_core_web_sm without code changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c9e1f0f commit 03439b9
1 file changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
17 | 30 | | |
18 | 31 | | |
19 | 32 | | |
| |||
32 | 45 | | |
33 | 46 | | |
34 | 47 | | |
35 | | - | |
| 48 | + | |
| 49 | + | |
36 | 50 | | |
37 | 51 | | |
38 | 52 | | |
| |||
42 | 56 | | |
43 | 57 | | |
44 | 58 | | |
45 | | - | |
| 59 | + | |
46 | 60 | | |
47 | 61 | | |
48 | 62 | | |
| |||
0 commit comments