You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: complete test parallelization for improved performance (#451)
## Summary
This PR completes the test suite optimization by adding parallel execution to all tests (both unit and integration), reducing the DatabaseExists timeout, and parallelizing CI jobs for improved performance.
## Changes
### Test Parallelization
- Added `t.Parallel()` to all unit test functions (~180 tests)
- Integration tests already had `t.Parallel()` at top level from previous commits
- Excluded tests using `t.Setenv()` due to Go testing constraints:
- TestFlagSystemVariablePrecedence
- TestDetermineInitialDatabase
- TestComplexFlagInteractions
### CI Workflow Optimization
- Split `lint` and `test` into independent jobs that run in parallel
- Added proper permissions for golangci-lint job (contents: read, pull-requests: read)
- Following golangci-lint best practices for parallel execution
### DatabaseExists Improvements
- Made context-aware by accepting context parameter
- Reduced timeout from 30s → 5s (more reasonable for simple API call)
- Fixed non-existent database test to use real instance
## Performance Impact
- TestRunMCP/database_does_not_exist: 34.87s → 5.63s (84% improvement)
- CI pipeline now runs tests and linting in parallel
- Overall test suite: ~26-28s (limited by intentional delays in timeout tests)
## Technical Details
- Tests with intentional 10s delays (TestReadWriteTransaction, TestReadOnlyTransaction) run in parallel
- Default `-parallel` (GOMAXPROCS) is optimal due to emulator concurrency limits
- All tests properly isolated with instance-level separation
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments