Commit 69aa2b6
committed
Fix intermittent 500 errors on GET /ping endpoint
Root cause: The /ping endpoint contained artificial error injection code that raised an Exception whenever int(time.time()) % 3 == 0, causing 500 errors approximately once every 3 seconds.
Changes:
- Removed error injection logic from /ping endpoint in app/main.py
- Added test_ping() to verify endpoint returns 200 with correct response
- Added test_ping_reliability() to test endpoint stability across multiple calls
All tests passing (3/3). The /ping endpoint now returns stable responses under continuous polling.1 parent 12f5d2d commit 69aa2b6
2 files changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | 15 | | |
19 | 16 | | |
20 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments