user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 3/7] t/www_listing: require opt-in for grokmirror tests
  2021-10-13 10:16  5% ` [PATCH 0/7] workaround Encode leak, several test fixes Eric Wong
@ 2021-10-13 10:16  7%   ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-10-13 10:16 UTC (permalink / raw)
  To: meta

grokmirror 2.x seems to idle in several places for 5s at-a-time,
causing t/www_listing.t to take longer than "make check-run" on
a 4-core system when run without grokmirror.  So make it
optional but add some test knobs to allow tailing the log
output so I can see what's going on.
---
 t/www_listing.t | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/t/www_listing.t b/t/www_listing.t
index eb77969b..c556a2d7 100644
--- a/t/www_listing.t
+++ b/t/www_listing.t
@@ -130,27 +130,31 @@ SKIP: {
 	tiny_test($json, $host, $port, 1);
 	undef $sock;
 
+	skip 'TEST_GROK unset', 12 unless $ENV{TEST_GROK};
 	my $grok_pull = require_cmd('grok-pull', 1) or
 		skip('grok-pull not available', 12);
 	my ($grok_version) = (xqx([$grok_pull, "--version"])
 			=~ /(\d+)\.(?:\d+)(?:\.(\d+))?/);
 	$grok_version >= 2 or
 		skip('grok-pull v2 or later not available', 12);
+	my $grok_loglevel = $ENV{TEST_GROK_LOGLEVEL} // 'info';
 
 	ok(mkdir("$tmpdir/mirror"), 'prepare grok mirror dest');
-	open $fh, '>', "$tmpdir/repos.conf" or die;
-	print $fh <<"" or die;
+	my $tail = tail_f("$tmpdir/grok.log");
+	open $fh, '>', "$tmpdir/repos.conf" or xbail $!;
+	print $fh <<"" or xbail $!;
 [core]
 toplevel = $tmpdir/mirror
 manifest = $tmpdir/local-manifest.js.gz
+log = $tmpdir/grok.log
+loglevel = $grok_loglevel
 [remote]
 site = http://$host:$port
 manifest = \${site}/manifest.js.gz
 [pull]
 [fsck]
 
-	close $fh or die;
-
+	close $fh or xbail $!;
 	xsys($grok_pull, '-c', "$tmpdir/repos.conf");
 	is($? >> 8, 0, 'grok-pull exit code as expected');
 	for (qw(alt bare v2/git/0.git v2/git/1.git v2/git/2.git)) {
@@ -159,18 +163,20 @@ manifest = \${site}/manifest.js.gz
 
 	# support per-inbox manifests, handy for v2:
 	# /$INBOX/v2/manifest.js.gz
-	open $fh, '>', "$tmpdir/per-inbox.conf" or die;
-	print $fh <<"" or die;
+	open $fh, '>', "$tmpdir/per-inbox.conf" or xbail $!;
+	print $fh <<"" or xbail $!;
 [core]
 toplevel = $tmpdir/per-inbox
 manifest = $tmpdir/per-inbox-manifest.js.gz
+log = $tmpdir/grok.log
+loglevel = $grok_loglevel
 [remote]
 site = http://$host:$port
 manifest = \${site}/v2/manifest.js.gz
 [pull]
 [fsck]
 
-	close $fh or die;
+	close $fh or xbail $!;
 	ok(mkdir("$tmpdir/per-inbox"), 'prepare single-v2-inbox mirror');
 	xsys($grok_pull, '-c', "$tmpdir/per-inbox.conf");
 	is($? >> 8, 0, 'grok-pull exit code as expected');

^ permalink raw reply	[relevance 7%]

* [PATCH 0/7] workaround Encode leak, several test fixes
  @ 2021-10-13 10:16  5% ` Eric Wong
  2021-10-13 10:16  7%   ` [PATCH 3/7] t/www_listing: require opt-in for grokmirror tests Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-10-13 10:16 UTC (permalink / raw)
  To: meta

Eric Wong (7):
  xt/perf-msgview: drop unnecessary use_ok
  test_common: hoist out tail_f sub
  t/www_listing: require opt-in for grokmirror tests
  eml: avoid Encode 2.87..3.12 leak
  t/lei-mirror: avoid reading ~/.public-inbox/config in test
  t/git: avoid "once" warning for async_warn
  t/nntpd-tls: change diag() to like() assertion

 lib/PublicInbox/Eml.pm        | 25 +++++++++-----
 lib/PublicInbox/TestCommon.pm | 63 ++++++++++++++++++++---------------
 t/git.t                       |  3 +-
 t/lei-mirror.t                |  1 +
 t/nntpd-tls.t                 |  3 +-
 t/www_listing.t               | 20 +++++++----
 xt/perf-msgview.t             |  1 -
 7 files changed, 70 insertions(+), 46 deletions(-)

^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | sort options + mbox downloads above
-- links below jump to the message on this page --
2021-10-12 10:59     Encode.pm leak in v2.87..v3.12 Eric Wong
2021-10-13 10:16  5% ` [PATCH 0/7] workaround Encode leak, several test fixes Eric Wong
2021-10-13 10:16  7%   ` [PATCH 3/7] t/www_listing: require opt-in for grokmirror tests Eric Wong

Code repositories for project(s) associated with this 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).