Commit 4e1204d
committed
perf(tests): fix hanging test issues and improve performance by 96%
- Completely refactor test_management_commands.py to eliminate hanging issues
- Add comprehensive process mocking to prevent real subprocess creation
- Implement test timeouts with pytest-timeout for safety
- Organize tests by performance characteristics (fast/subprocess/process/template)
- Mock ProcessManager entirely to prevent runserver from starting real processes
- Improve subprocess mocking to include both subprocess.run and subprocess.Popen
Performance improvements:
- Test runtime: 3.29s → 0.12s (96% faster)
- Eliminated all hanging risks from runserver tests
- More reliable and predictable test execution
- Better separation of concerns in test organization
Technical changes:
- Add pytest-timeout>=2.3.1 dependency
- Split tests into logical performance-based classes
- Enhanced mocking strategy for better isolation
- Removed redundant tests while maintaining coverage1 parent 27a4d45 commit 4e1204d
3 files changed
+240
-237
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
0 commit comments