1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-10-30 23:37:45 +02:00

Added --retry option.

This commit is contained in:
David Steele
2017-02-21 22:10:02 -05:00
parent 023578c008
commit 31d2d790bd
3 changed files with 14 additions and 5 deletions

View File

@@ -58,6 +58,7 @@ sub new
$self->{bShowOutputAsync},
$self->{bCoverage},
$self->{bNoCleanup},
$self->{iRetry},
) =
logDebugParam
(
@@ -77,6 +78,7 @@ sub new
{name => 'bShowOutputAsync'},
{name => 'bCoverage'},
{name => 'bNoCleanup'},
{name => 'iRetry'},
);
# Set try to 0
@@ -106,9 +108,9 @@ sub run
# Should the job be run?
$self->{iTry}++;
if ($self->{iTry} <= 2)
if ($self->{iTry} <= ($self->{iRetry} + 1))
{
if ($self->{iTry} > 1)
if ($self->{iTry} != 1 && $self->{iTry} == ($self->{iRetry} + 1))
{
$self->{strLogLevel} = lc(DEBUG);
}

View File

@@ -72,7 +72,7 @@ test.pl [options]
--coverage perform coverage analysis
--smart perform libc/package builds only when source timestamps have changed
--no-package do not build packages
--dev enable --no-lint --smart --no-package --vm-out --process-max=1
--dev enable --no-lint --smart --no-package --vm-out --process-max=1 --retry=0
Configuration Options:
--psql-bin path to the psql executables (e.g. /usr/lib/postgresql/9.3/bin/)
@@ -122,6 +122,7 @@ my $bCoverage = false;
my $bSmart = false;
my $bNoPackage = false;
my $bDev = false;
my $iRetry = 1;
GetOptions ('q|quiet' => \$bQuiet,
'version' => \$bVersion,
@@ -149,7 +150,8 @@ GetOptions ('q|quiet' => \$bQuiet,
'no-package' => \$bNoPackage,
'coverage' => \$bCoverage,
'smart' => \$bSmart,
'dev' => \$bDev)
'dev' => \$bDev,
'retry=s' => \$iRetry)
or pod2usage(2);
####################################################################################################################################
@@ -643,7 +645,8 @@ eval
{
my $oJob = new pgBackRestTest::Common::JobTest(
$strBackRestBase, $strTestPath, $strCoveragePath, $$oyTestRun[$iTestIdx], $bDryRun, $bVmOut, $iVmIdx,
$iVmMax, $iTestIdx, $iTestMax, $strLogLevel, $bLogForce, $bShowOutputAsync, $bCoverage, $bNoCleanup);
$iVmMax, $iTestIdx, $iTestMax, $strLogLevel, $bLogForce, $bShowOutputAsync, $bCoverage, $bNoCleanup,
$iRetry);
$iTestIdx++;
if ($oJob->run())