[jifty-devel] The Test::Builder hack

Michael G Schwern schwern at bestpractical.com
Thu Oct 26 02:28:49 EDT 2006


So there's this hack in Jifty::Script::Server to work around some sort of Test::Builder incompatibility:

# properly closed, causing the client to wait for the content for a                                                     
# 302 redirect, see t/06-signup.t, which timeouts after test 24.                                                        
# If we load this after we load the rest of Jifty, its die handler clobbers ours.                                       
# HATE.  And even worse, Test::Builder clobbers our global SIG{__DIE__} handler.                                        
# So we work around the work around. The real answer is to figure out how Test::Builder                                 
# makes our test server not hang and do just that                                                                       
my $x;
BEGIN {$x = $SIG{__DIE__}; }
use Test::Builder ();
BEGIN { $SIG{__DIE__} = $x;}

The funny thing is there's no __DIE__ handlers in Jifty.  Maybe there were, but they're gone now.

0 windhund ~/devel/jifty$ rgrep '__DIE__'
./lib/Jifty/Dispatcher.pm:    local $SIG{__DIE__} = 'DEFAULT';
./lib/Jifty/Object.pm:    local $SIG{__DIE__} = 'DEFAULT';
./lib/Jifty/Script/Server.pm:# HATE.  And even worse, Test::Builder clobbers our global SIG{__DIE__} handler.
./lib/Jifty/Script/Server.pm:BEGIN {$x = $SIG{__DIE__}; }
./lib/Jifty/Script/Server.pm:BEGIN { $SIG{__DIE__} = $x;}

I think t/06-signup.t refers to a Hiveminder test and it works fine without the hack.

Does anyone remember how to tickle the problem?  I'd like to eliminate this hack if its no longer relevant.


More information about the jifty-devel mailing list