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
refactor: remove RunInSeparateProcess and fix test blocking issues
This commit removes all #[RunInSeparateProcess] attributes from tests and fixes
several blocking issues that were causing test failures and risky test warnings.
Changes:
1. Removed #[RunInSeparateProcess] from all test files:
- tests/shared/TableCommandCliTests.php
- tests/shared/GenerateCommandCliTests.php
- tests/mysql/UserCommandCliTests.php
- tests/mariadb/UserCommandCliTests.php
- tests/postgresql/UserCommandCliTests.php
2. Modified bin/pdodb to throw exception instead of exit() in PHPUNIT mode:
- Added check for PHPUNIT environment variable
- Throws RuntimeException with exit code instead of calling exit()
- Allows tests to run without separate processes
3. Replaced shell_exec tests with direct Application->run() calls:
- testKeysAddWithoutRequiredParamsYieldsError()
- testKeysDropWithoutNameYieldsError()
- testCreateTableWithoutColumnsYieldsError()
- testGenerateUnknownSubcommand()
- All tests now use Application->run() directly with proper error handling
4. Fixed risky tests with output buffer issues:
- Added ob_get_level() tracking before ob_start()
- Added cleanup loop in catch blocks: while (ob_get_level() > ) { ob_end_clean(); }
- Fixed 7 risky tests:
* testAskCachingWithRedisType()
* testAskCachingWithMemcachedType()
* testAskCachingWithApcuType()
* testAskCachingWithInvalidType()
* testAskCachingWithArrayType()
* testAskPerformanceWithAllOptions()
* testAskMultipleConnectionsStructure()
5. Fixed input blocking in Dashboard for non-interactive mode:
- Added non-interactive check in showConfirmationDialog()
- Added non-interactive check in showHelp()
- Both methods now return immediately in non-interactive mode instead of
waiting for user input in infinite loops
Search keywords for future debugging:
- RunInSeparateProcess removal
- test blocking issues
- output buffer risky tests
- Dashboard input blocking
- PHPUNIT exception handling
- non-interactive mode fixes
0 commit comments