From: Eric Wong Date: Fri, 6 Oct 2023 09:46:03 +0000 (+0000) Subject: t/dir_idle: dump event list on failure X-Git-Tag: v2.0.0~902 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aef38b546fd15f161dc0f0c2c9ec9b7b7798672a;p=thirdparty%2Fpublic-inbox.git t/dir_idle: dump event list on failure Hopefully this makes it easier to diagnose portability problems on new OSes we use. --- diff --git a/t/dir_idle.t b/t/dir_idle.t index bb6f47ebb..02759b543 100644 --- a/t/dir_idle.t +++ b/t/dir_idle.t @@ -1,7 +1,7 @@ #!perl -w # Copyright (C) all contributors # License: AGPL-3.0+ -use v5.12; use strict; use PublicInbox::TestCommon; +use v5.12; use PublicInbox::TestCommon; use PublicInbox::DS qw(now); use File::Path qw(make_path); use_ok 'PublicInbox::DirIdle'; @@ -26,10 +26,12 @@ rmdir("$tmpdir/a") or xbail "rmdir $!"; @x = (); $end = 3 + now; PublicInbox::DS::event_loop(); -is(scalar(@x), 1, 'got an event') and +if (is(scalar(@x), 1, 'got an event after rmdir')) { is($x[0]->[0]->fullname, "$tmpdir/a", 'got expected fullname') and ok($x[0]->[0]->IN_DELETE_SELF, 'IN_DELETE_SELF set'); - +} else { + diag explain(\@x); +} rename("$tmpdir/c", "$tmpdir/j") or xbail "rmdir $!"; @x = (); $end = 3 + now;