]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
xt/check-run: call DS->Reset after all tests
authorEric Wong <e@80x24.org>
Wed, 25 Oct 2023 00:29:31 +0000 (00:29 +0000)
committerEric Wong <e@80x24.org>
Wed, 25 Oct 2023 07:28:35 +0000 (07:28 +0000)
This ensures reused processes get a clean start and
avoids surprises as we develop more code around the
DS event loop.

t/dir_idle.t
t/fake_inotify.t
xt/check-run.t

index 35c800f98b99aa83256db7ba410d5c22462f3e2f..14aad7a1654042f22304d972b3d93064819f4ac2 100644 (file)
@@ -41,5 +41,4 @@ is(scalar(@x), 1, 'got an event') and
        ok($x[0]->[0]->IN_DELETE_SELF || $x[0]->[0]->IN_MOVE_SELF,
                'IN_DELETE_SELF set on move');
 
-PublicInbox::DS->Reset;
 done_testing;
index 56f64588d71f634db99f4feef95c7dfe50f3f23e..8221e092a218c8c1e91e447faa06fd5d50296367 100644 (file)
@@ -48,6 +48,4 @@ is_deeply([map{ $_->fullname }@events], ["$tmpdir/new/tst"], 'unlink detected')
        diag explain(\@events);
 ok($events[0]->IN_DELETE, 'IN_DELETE set on unlink');
 
-PublicInbox::DS->Reset;
-
 done_testing;
index 6eefcb7d8f200f19d290db3895c92ca47491f560..cda839fe97a381f06a2f0864c894c1762f4d31dd 100755 (executable)
@@ -14,6 +14,7 @@ use v5.12;
 use IO::Handle; # ->autoflush
 use PublicInbox::TestCommon;
 use PublicInbox::Spawn;
+use PublicInbox::DS; # already loaded by Spawn via ProcessIO
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
 use Errno qw(EINTR);
 use Fcntl qw(:seek);
@@ -187,6 +188,7 @@ my $start_worker = sub {
                        DIE "short read $r" if $r != UINT_SIZE;
                        my $t = unpack('I', $buf);
                        run_test($todo->[$t]);
+                       PublicInbox::DS->Reset;
                        $tb->reset;
                }
                kill 'USR1', $producer if !$eof; # sets $eof in $producer