chiark / gitweb /
Test suite: Rename dgit-repos-policy-debian DB retry hook env var (nfc)
[dgit.git] / infra / dgit-repos-policy-debian
index 5d843a06b611423e805b734567bce3f875c4126d..4af7551c512014b0224f348ac44603415cc0b48c 100755 (executable)
@@ -86,7 +86,9 @@ our %deliberately;
 sub apiquery ($) {
     my ($subpath) = @_;
     local $/=undef;
-    my $cmd = "$dgitlive/dgit -d$distro \$DGIT_TEST_OPTS";
+    my $dgit = "$dgitlive/dgit";
+    $dgit = "dgit" if !stat_exists $dgit;
+    my $cmd = "$dgit -d$distro \$DGIT_TEST_OPTS";
     $cmd .= " -".("D" x $debuglevel) if $debuglevel;
     $cmd .= " archive-api-query $subpath";
     printdebug "apiquery $cmd\n";
@@ -462,6 +464,10 @@ for (;;) {
        poldb_setup(poldb_path($repos));
        $stderr = '';
 
+       eval ($ENV{'DGIT_RPD_TEST_DBLOOP_HOOK'}//'');
+       die $@ if length $@;
+       # used by tests/tests/debpolicy-dbretry
+
        $poldbh->{HandleError} = sub {
            return 0 unless $poldbh->err == 5; # SQLITE_BUSY, not in .pm :-(
            die bless { }, $db_busy_exception;