From: Peter Rabbitson Date: Thu, 10 Mar 2016 18:02:00 +0000 (+0100) Subject: Really work around RT#108390 (630e2ea8a) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=820a2936;p=dbsrgits%2FDBIx-Class.git Really work around RT#108390 (630e2ea8a) A certain chain of events can still deadlock things without an explicit flush --- diff --git a/t/lib/DBICTest/Util.pm b/t/lib/DBICTest/Util.pm index 68b6e2c..b084560 100644 --- a/t/lib/DBICTest/Util.pm +++ b/t/lib/DBICTest/Util.pm @@ -88,7 +88,21 @@ sub await_flock ($$) { # "say something" every 10 cycles to work around RT#108390 # jesus christ our tooling is such a crock of shit :( - print "#\n" if not $tries % 10; + unless ( $tries % 10 ) { + + # Turning on autoflush is crucial: if stars align just right buffering + # will ensure we never actually call write() underneath until the grand + # timeout is reached (and that's too long). Reproducible via + # + # DBICTEST_VERSION_WARNS_INDISCRIMINATELY=1 \ + # DBICTEST_RUN_ALL_TESTS=1 \ + # strace -f \ + # prove -lj10 xt/extra/internals/ + # + select( ( select(\*STDOUT), $|=1 )[0] ); + + print "#\n"; + } } return $res;