Commit 153a0a7
Fix parallel test failures: suppress SQLite table creation race condition and add pytest-asyncio dependency
The CI failure was caused by two issues:
1. Module-level Base.metadata.create_all() in gh_file_viewer.py raced when
multiple pytest-xdist workers imported the module simultaneously, causing
'table search_results already exists' errors during test collection.
2. pytest-asyncio was missing from test dependencies, which would cause
async test functions to fail after collection.
Changes:
- Wrap create_all() with contextlib.suppress(Exception) to handle concurrent
table creation attempts gracefully
- Add pytest-asyncio as a hatch-test extra dependency
- Set asyncio_mode = "auto" in pytest config
Agent-Logs-Url: https://github.com/GitHubSecurityLab/seclab-taskflows/sessions/84c7962f-5966-4924-8617-8378affd1621
Co-authored-by: p- <176818+p-@users.noreply.github.com>1 parent 90a3b91 commit 153a0a7
2 files changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| |||
122 | 127 | | |
123 | 128 | | |
124 | 129 | | |
| 130 | + | |
125 | 131 | | |
126 | 132 | | |
127 | 133 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
0 commit comments