From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 1A3D51F68D for ; Mon, 23 Oct 2023 08:48:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1698050919; bh=ejS9gjANNXFX/tzV3oV49NetiUXs2F9GaNR+9ReO2AE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Q9TPfLbhqUHSHJBgoOhkMuFgIpvj+zrwpCUzLvoSFy7ANCwzuVje/DtMzto+kbMnX 3Jxoj1zCo2+30IWv5zDu1ZkZ2Zc0A6QClquOwc0eZpvrBHL6UaoZn8PT9HyjstpBYm 4/vOYob+DC2WAAGjhU+gNkuOgjNZvnEdGBPu04Lo= From: Eric Wong To: spew@80x24.org Subject: [PATCH 08/18] xt/check-run: call DS->Reset after all tests Date: Mon, 23 Oct 2023 08:48:27 +0000 Message-ID: <20231023084837.2804687-8-e@80x24.org> In-Reply-To: <20231023084837.2804687-1-e@80x24.org> References: <20231023084837.2804687-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 1 - t/fake_inotify.t | 2 -- xt/check-run.t | 2 ++ 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/t/dir_idle.t b/t/dir_idle.t index 35c800f9..14aad7a1 100644 --- a/t/dir_idle.t +++ b/t/dir_idle.t @@ -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; diff --git a/t/fake_inotify.t b/t/fake_inotify.t index 56f64588..8221e092 100644 --- a/t/fake_inotify.t +++ b/t/fake_inotify.t @@ -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; diff --git a/xt/check-run.t b/xt/check-run.t index 6eefcb7d..cda839fe 100755 --- a/xt/check-run.t +++ b/xt/check-run.t @@ -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