* [PATCH 3/4] t/*.t: localize $SIG{__WARN__} changes
2020-04-11 10:53 5% [PATCH 0/4] FreeBSD and test fixes Eric Wong
@ 2020-04-11 10:53 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-04-11 10:53 UTC (permalink / raw)
To: meta
We don't want to propagate %SIG changes to other tests when
running multiple tests within the same process via t/run.perl.
---
t/mda_filter_rubylang.t | 2 +-
t/nntpd.t | 2 +-
t/watch_filter_rubylang.t | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/mda_filter_rubylang.t b/t/mda_filter_rubylang.t
index dbcb275b..6f288b7e 100644
--- a/t/mda_filter_rubylang.t
+++ b/t/mda_filter_rubylang.t
@@ -18,7 +18,7 @@ is(system(@cfg, 'publicinboxmda.spamcheck', 'none'), 0);
for my $v (qw(V1 V2)) {
my @warn;
- $SIG{__WARN__} = sub { push @warn, @_ };
+ local $SIG{__WARN__} = sub { push @warn, @_ };
my $cfgpfx = "publicinbox.$v";
my $inboxdir = "$tmpdir/$v";
my $addr = "test-$v\@example.com";
diff --git a/t/nntpd.t b/t/nntpd.t
index 43b14d66..826e3f3d 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -268,7 +268,7 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000
$for_leafnode->header_set('Message-ID', @mids);
$for_leafnode->body_set('not-a-dupe');
my $warn = '';
- $SIG{__WARN__} = sub { $warn .= join('', @_) };
+ local $SIG{__WARN__} = sub { $warn .= join('', @_) };
$im->add($for_leafnode);
$im->done;
like($warn, qr/reused/, 'warned for reused MID');
diff --git a/t/watch_filter_rubylang.t b/t/watch_filter_rubylang.t
index b4540660..09217d94 100644
--- a/t/watch_filter_rubylang.t
+++ b/t/watch_filter_rubylang.t
@@ -24,7 +24,7 @@ SKIP: {
for my $v (@v) {
my @warn;
- $SIG{__WARN__} = sub { push @warn, @_ };
+ local $SIG{__WARN__} = sub { push @warn, @_ };
my $cfgpfx = "publicinbox.$v";
my $inboxdir = "$tmpdir/$v";
my $maildir = "$tmpdir/md-$v";
^ permalink raw reply related [relevance 7%]
* [PATCH 0/4] FreeBSD and test fixes
@ 2020-04-11 10:53 5% Eric Wong
2020-04-11 10:53 7% ` [PATCH 3/4] t/*.t: localize $SIG{__WARN__} changes Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-04-11 10:53 UTC (permalink / raw)
To: meta
Looping the tests for hours on end with a FreeBSD 11.2 VM
revealed some problems (and a minor cleanup) I didn't
find on my Debian GNU/Linux systems.
Eric Wong (4):
testcommon: DESTROY: wait for killed daemon
dskqxs: ignore EV_SET errors on EVFILT_WRITE
t/*.t: localize $SIG{__WARN__} changes
t/httpd-corner.t: relax read-after-failed-write handling
lib/PublicInbox/DSKQXS.pm | 4 ++--
lib/PublicInbox/TestCommon.pm | 6 +++---
lib/PublicInbox/Xapcmd.pm | 6 +++++-
t/httpd-corner.t | 39 +++++++++++++++++++++--------------
t/mda_filter_rubylang.t | 2 +-
t/nntpd.t | 2 +-
t/watch_filter_rubylang.t | 2 +-
7 files changed, 36 insertions(+), 25 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-04-11 10:53 5% [PATCH 0/4] FreeBSD and test fixes Eric Wong
2020-04-11 10:53 7% ` [PATCH 3/4] t/*.t: localize $SIG{__WARN__} changes Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).