-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathtest_durations.txt
More file actions
36 lines (33 loc) · 2.13 KB
/
test_durations.txt
File metadata and controls
36 lines (33 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Test durations — 161 tests (was 189)
=====================================
Optimizations applied:
1. Session-scoped app (no per-test create_app)
2. JSON fixture for article/NLP data (no Stanza at setup)
3. Wordstats mock (no 400k WordInfo load)
4. Feed test consolidation (5→1), then deletion
5. Article test consolidation (4→1)
6. Deleted redundant slow tests (feed download, Article.find_or_create, test_create_article)
7. Fixed cache-before-tokenizer bug in article.get_tokenized_content()
8. Removed unused hardcoded feeds from FeedRule (was creating 4 feeds per BookmarkRule)
9. Bookmark test consolidation (18→3)
Full suite history:
ORIGINAL: ~160s (2:40) 189 tests — function-scoped app, live Stanza + wordstats
AFTER 1-3: ~110s (1:50) 184 tests — session-scoped app, JSON fixture, wordstats mock
AFTER 1-6: ~52s (0:52) 176 tests — + deletions and consolidations
AFTER 1-8: ~55s (0:55) 176 tests — + cache fix (test_starred_or_liked: 6.5s → 0.25s)
AFTER 1-9: ~46s (0:46) 161 tests — + bookmark consolidation (18→3)
Production bug fixed:
article.get_tokenized_content() loaded Stanza BEFORE checking cache.
Now checks cache first — on hit, returns immediately without loading tokenizer.
test_starred_or_liked: 6.50s → 0.25s (also saves time in production)
Current top 10 slowest (46s total, 161 tests):
15.18s test_bookmark_quality_and_study — creates 10+ bookmarks inline (consolidated)
6.83s test_contribute_own_translation — API bookmark contribution
4.38s session setup (one-time) — create_app loads spaCy models at import time
2.21s test_article_topics_and_basics — ArticleRule creates 2 fake articles
1.89s test_exercises — creates bookmarks + exercises (consolidated)
1.65s test_add_exercise_to_session — exercise scheduling logic
0.94s test_number_detection — tokenizer test
0.71s test_no_null_positions — bookmark positions
0.68s test_bookmark_counts_by_date — user bookmark stats
0.63s test_ml_classification — quality filter