Re: -fetch failures [was: latest make test failures on CentOS-7]

2021-09-27 Thread Konstantin Ryabitsev
On Mon, Sep 27, 2021 at 07:33:46PM +, Eric Wong wrote:
> Konstantin Ryabitsev  wrote:
> > t/v2mirror.t . 71/? W: 
> > /tmp/pi-v2mirror-39373-Dl1N/m/git/3.git missing remote.origin.url
> > fatal: not a git repository: '/tmp/pi-v2mirror-39373-Dl1N/m/git/3.git'
> > git --git-dir=/tmp/pi-v2mirror-39373-Dl1N/m/git/3.git fetch -q failed
> > Bailout called.  Further testing stopped:  -fetch failed
> > FAILED--Further testing stopped: -fetch failed
> > make: *** [test_dynamic] Error 255
> > 
> > FYI, this is git 2.31.1.
> 
> I'm not seeing this at all with 2.31.1, 2.20, 2.33...
> I wonder if there's a permissions problem or some latent GIT_*
> var in env...
> 
> Are you testing as root?  I think that would be broken, yes.

Yes, this is testing as root, largely because automatic deployment makes it
hard to do the checkout/make/make test as an unprivileged user. I appreciate
that in most other scenarios the final step would be "sudo make install" but
when things are installed via configuration management, the process usually
runs as root already and su-ing to a user for "make test" is adding more
complication to the process.

> The partial fetching would need some work to support working as
> root.

Ah. Just catch this with check if if id=0 and skipping the test as "known not
to work for this use-case."

-K



-fetch failures [was: latest make test failures on CentOS-7]

2021-09-27 Thread Eric Wong
Konstantin Ryabitsev  wrote:
> t/v2mirror.t . 71/? W: 
> /tmp/pi-v2mirror-39373-Dl1N/m/git/3.git missing remote.origin.url
> fatal: not a git repository: '/tmp/pi-v2mirror-39373-Dl1N/m/git/3.git'
> git --git-dir=/tmp/pi-v2mirror-39373-Dl1N/m/git/3.git fetch -q failed
> Bailout called.  Further testing stopped:  -fetch failed
> FAILED--Further testing stopped: -fetch failed
> make: *** [test_dynamic] Error 255
> 
> FYI, this is git 2.31.1.

I'm not seeing this at all with 2.31.1, 2.20, 2.33...
I wonder if there's a permissions problem or some latent GIT_*
var in env...

Are you testing as root?  I think that would be broken, yes.
The partial fetching would need some work to support working as
root.

> I'll be happy to help troubleshoot things as necessary.

Otherwise, dumping the config and some more info could help...

diff --git a/lib/PublicInbox/Fetch.pm b/lib/PublicInbox/Fetch.pm
index 7881b402e3f6..a5e4c43c039b 100644
--- a/lib/PublicInbox/Fetch.pm
+++ b/lib/PublicInbox/Fetch.pm
@@ -122,6 +122,10 @@ sub do_fetch { # main entry point
$epoch = $nr;
} else {
warn "W: $edir missing remote.origin.url\n";
+   my $pid = spawn([qw(git config -l)], undef,
+   { 1 => $lei->{2}, 2 => $lei->{2} });
+   waitpid($pid, 0);
+   $lei->child_error($?) if $?;
}
}
@epochs = grep { !$skip->{$_} } @epochs if $skip;
diff --git a/t/v2mirror.t b/t/v2mirror.t
index 63d17ebfebba..e3936919306b 100644
--- a/t/v2mirror.t
+++ b/t/v2mirror.t
@@ -5,6 +5,7 @@ use v5.10.1;
 use PublicInbox::TestCommon;
 use File::Path qw(remove_tree make_path);
 use Cwd qw(abs_path);
+use Carp ();
 use PublicInbox::Spawn qw(which);
 require_git(2.6);
 require_cmd('curl');
@@ -102,7 +103,9 @@ my @new_epochs;
 my $fetch_each_epoch = sub {
my %before = map { $_ => 1 } glob("$tmpdir/m/git/*");
run_script([qw(-fetch --exit-code -q)], undef, {-C => "$tmpdir/m"}) or
-   xbail '-fetch fail';
+   xbail('-fetch fail ',
+   [ xqx([which('find'), "$tmpdir/m", qw(-type f -ls) ]) ],
+   Carp::longmess());
is($?, 0, '--exit-code 0 after fetch updated');
my @after = grep { !$before{$_} } glob("$tmpdir/m/git/*");
push @new_epochs, @after;
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/



latest make test failures on CentOS-7

2021-09-27 Thread Konstantin Ryabitsev
Hello:

I wanted to try the searchable /all/ from www_index, but it looks like I'm
unable to get a clean make test. Below are a few failures that I can see:

t/cmd_ipc.t .. 29/?
#   Failed test 'got EMSGSIZE'
#   at t/cmd_ipc.t line 108.
# Looks like you failed 1 test of 42.
t/cmd_ipc.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/42 subtests
(less 13 skipped subtests: 28 okay)

[...]

t/lei-index.t  11/?
#   Failed test 'lei index imap://$HOST_PORT/t.v2.0'
#   at /usr/local/share/public-inbox/blib/lib/PublicInbox/TestCommon.pm 
line 519.
# $?=6400 err=E: eval-ed lei: Mail::IMAPClient is required for IMAP:
# Can't locate Mail/IMAPClient.pm in @INC (@INC contains: 
/root/.cache/public-inbox/inline-c/lib /root/.cache/public-inbox/inline-c/lib 
/usr/local/share/public-inbox/blib/lib /usr/local/share/public-inbox/blib/arch 
/usr/local/lib64/perl5 /usr/local/share/perl5/x86_64-linux-thread-multi 
/usr/local/share/perl5 /usr/lib64/perl5/vendor_perl 
/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . 
/usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl 
/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at 
/usr/share/perl5/vendor_perl/parent.pm line 20.
# BEGIN failed--compilation aborted at 
/usr/local/share/public-inbox/blib/lib/PublicInbox/IMAPClient.pm line 13.
# Compilation failed in require at 
/usr/local/share/public-inbox/blib/lib/PublicInbox/NetReader.pm line 433.
#
#
# Looks like you failed 1 test of 36.
t/lei-index.t  Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/36 subtests

(Normal, I don't have Mail::IMAPClient, but should probably fail differently.)

t/lei-tag.t .. 23/?
#   Failed test 'lei _complete lei tag'
#   at /usr/local/share/public-inbox/blib/lib/PublicInbox/TestCommon.pm 
line 519.
# $?=6400 err=E: eval-ed lei: Modification of non-creatable array value 
attempted, subscript -1 at 
/usr/local/share/public-inbox/blib/lib/PublicInbox/LeiImport.pm line 125.
#

#   Failed test 'completed with labels'
#   at t/lei-tag.t line 73.
# Looks like you failed 2 tests of 65.
t/lei-tag.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/65 subtests
t/lei-up.t ... ok
t/lei-watch.t  ok
t/lei.t .. 43/?
#   Failed test 'lei _complete lei import'
#   at /usr/local/share/public-inbox/blib/lib/PublicInbox/TestCommon.pm 
line 519.
# $?=6400 err=E: eval-ed lei: Modification of non-creatable array value 
attempted, subscript -1 at 
/usr/local/share/public-inbox/blib/lib/PublicInbox/LeiImport.pm line 125.
#
# Looks like you failed 1 test of 151.
t/lei.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/151 subtests

[...]

t/v2mirror.t . 71/? W: 
/tmp/pi-v2mirror-39373-Dl1N/m/git/3.git missing remote.origin.url
fatal: not a git repository: '/tmp/pi-v2mirror-39373-Dl1N/m/git/3.git'
git --git-dir=/tmp/pi-v2mirror-39373-Dl1N/m/git/3.git fetch -q failed
Bailout called.  Further testing stopped:  -fetch failed
FAILED--Further testing stopped: -fetch failed
make: *** [test_dynamic] Error 255

FYI, this is git 2.31.1.

I'll be happy to help troubleshoot things as necessary.

-K