From: Peter Rabbitson Date: Sun, 28 Feb 2016 13:04:08 +0000 (+0100) Subject: Revert part of bbcc1fe8 - the 'queue unstick hack' belongs in DBICTest X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=970ed9a14ced481ba1011b2ed68fa9d8a4c2d5ae;p=dbsrgits%2FDBIx-Class.git Revert part of bbcc1fe8 - the 'queue unstick hack' belongs in DBICTest DBICTest::Util is more likely to be loaded before Test::More, voiding the check in the BEGIN. DBICTest on the other hand is almost invariably loaded after T::M. --- diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index c0c91c2..849caa1 100644 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -4,6 +4,25 @@ package # hide from PAUSE use strict; use warnings; + +# this noop trick initializes the STDOUT, so that the TAP::Harness +# issued IO::Select->can_read calls (which are blocking wtf wtf wtf) +# keep spinning and scheduling jobs +# This results in an overall much smoother job-queue drainage, since +# the Harness blocks less +# (ideally this needs to be addressed in T::H, but a quick patchjob +# broke everything so tabling it for now) +BEGIN { + # FIXME - there probably is some way to determine a harness run (T::H or + # prove) but I do not know it offhand, especially on older environments + # Go with the safer option + if ($INC{'Test/Builder.pm'}) { + local $| = 1; + print "#\n"; + } +} + + use DBICTest::Util qw( local_umask await_flock dbg DEBUG_TEST_CONCURRENCY_LOCKS ); use DBICTest::Schema; use DBICTest::Util::LeakTracer qw/populate_weakregistry assert_empty_weakregistry/; diff --git a/t/lib/DBICTest/Util.pm b/t/lib/DBICTest/Util.pm index f747210..37c7916 100644 --- a/t/lib/DBICTest/Util.pm +++ b/t/lib/DBICTest/Util.pm @@ -3,20 +3,6 @@ package DBICTest::Util; use warnings; use strict; -# this noop trick initializes the STDOUT, so that the TAP::Harness -# issued IO::Select->can_read calls (which are blocking wtf wtf wtf) -# keep spinning and scheduling jobs -# This results in an overall much smoother job-queue drainage, since -# the Harness blocks less -# (ideally this needs to be addressed in T::H, but a quick patchjob -# broke everything so tabling it for now) -BEGIN { - if ($INC{'Test/Builder.pm'}) { - local $| = 1; - print "#\n"; - } -} - use constant DEBUG_TEST_CONCURRENCY_LOCKS => ( ($ENV{DBICTEST_DEBUG_CONCURRENCY_LOCKS}||'') =~ /^(\d+)$/ )[0] ||