Opened 10 months ago

#105 new enhancement

Prevent deadlock when debugging with xDebug

Reported by: scribu Owned by:
Priority: normal Milestone: Implement New Test Runner
Component: Admin Screen Keywords:
Cc:

Description

Originally reported here: https://github.com/nb/wordpress-tests/issues/27

In wordpress-tests/init.php, there's a system(php ...) call. When I remote-debug my unit test suite, the external PHP process that's created by that system(php ...) call attempts to connect to the debugger. But the debugger is blocked — the parent PHP process is already open in the debugger (executing the system call).

So both PHP processes hangs / deadlocks forever.

A solution, that works for me anyway (with Ubuntu Linux), is to prepend 'XDEBUG_CONFIG="remote_enable=Off" ' to the PHP command. That is, change from:

`
system( WP_PHP_BINARY . ' ' . escapeshellarg( dirname( FILE ) .

'/bin/install.php' ) . ' ' . escapeshellarg( $config_file_path ) );

`

to:

`
$install_blog_cmd =

'XDEBUG_CONFIG="remote_enable=Off" ' .
WP_PHP_BINARY .
' ' . escapeshellarg( dirname( FILE ) . '/bin/install.php' ) .
' ' . escapeshellarg( $config_file_path );

system( $install_blog_cmd );
`

But I don't know what MS Windows would think about that. Perhaps it'd be possible to invoke a shell script or a .bat script that work on both Linux/Mac? and Windows.

Thanks for building wordpress-test by the way, it seems really useful! :-)
Best regards, KajMagnus?

(PS. Here is a wordpress.stackexchange.com question about this, that I've marked as solved. http://wordpress.stackexchange.com/q/58294/4211 )

Change History (0)

Note: See TracTickets for help on using tickets.