1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-05-22 10:15:16 +02:00

Remove test point infrastructure.

82df7e6f and 9856fef5 updated tests that used test points in preparation for the feature not being available in the C code.

Since tests points are no longer used remove the infrastructure.

Also remove one stray --test option in mock/all that was essentially a noop but no longer works now that the option has been removed.
This commit is contained in:
David Steele
2019-12-10 13:16:47 -05:00
parent d7d663c2b9
commit d0ba8ff58c
20 changed files with 23 additions and 455 deletions
+3 -25
View File
@@ -131,13 +131,11 @@ sub endRetry
my
(
$strOperation,
$strTest,
$bWait
) =
logDebugParam
(
__PACKAGE__ . '->endRetry', \@_,
{name => 'strTest', required => false, trace => true},
{name => 'bWait', required => false, default => true, trace => true}
);
@@ -173,12 +171,6 @@ sub endRetry
{
syswrite(*STDOUT, " ${strLine}\n")
}
if (defined($strTest) && testCheck($strLine, $strTest))
{
&log(DEBUG, "Found test ${strTest}");
return true;
}
}
# Drain the stderr stream
@@ -272,11 +264,6 @@ sub endRetry
print "output:\n$self->{strOutLog}\n";
}
if (defined($strTest))
{
confess &log(ASSERT, "test point ${strTest} was not found");
}
# Return from function and log return values if any
return logDebugReturn
(
@@ -296,13 +283,11 @@ sub end
my
(
$strOperation,
$strTest,
$bWait
) =
logDebugParam
(
__PACKAGE__ . '->end', \@_,
{name => 'strTest', required => false, trace => true},
{name => 'bWait', required => false, default => true, trace => true}
);
@@ -311,7 +296,7 @@ sub end
if (!defined($self->{iRetrySeconds}))
{
$iExitStatus = $self->endRetry($strTest, $bWait);
$iExitStatus = $self->endRetry($bWait);
}
# Else loop until success or timeout
else
@@ -322,7 +307,7 @@ sub end
{
$self->{bRetry} = false;
$self->begin();
$iExitStatus = $self->endRetry($strTest, $bWait);
$iExitStatus = $self->endRetry($bWait);
if ($self->{bRetry})
{
@@ -334,7 +319,7 @@ sub end
if ($self->{bRetry})
{
$self->begin();
$iExitStatus = $self->endRetry($strTest, $bWait);
$iExitStatus = $self->endRetry($bWait);
}
}
@@ -353,16 +338,9 @@ sub executeTest
{
my $strCommand = shift;
my $oParam = shift;
my $strTest = shift;
my $oExec = new pgBackRestTest::Common::ExecuteTest($strCommand, $oParam);
$oExec->begin();
if (defined($strTest))
{
$oExec->end($strTest);
}
$oExec->end();
return $oExec->{strOutLog};
+1 -1
View File
@@ -574,7 +574,7 @@ sub end
my $strTestDone = $self->{oProcess}{test};
my $iTestDoneIdx = $self->{oProcess}{idx};
my $iExitStatus = $oExecDone->end(undef, $self->{iVmMax} == 1);
my $iExitStatus = $oExecDone->end($self->{iVmMax} == 1);
if (defined($iExitStatus))
{
@@ -169,8 +169,6 @@ sub backupBegin
);
# Set defaults
my $strTest = defined($$oParam{strTest}) ? $$oParam{strTest} : undef;
my $fTestDelay = defined($$oParam{fTestDelay}) ? $$oParam{fTestDelay} : .2;
my $oExpectedManifest = defined($$oParam{oExpectedManifest}) ? $$oParam{oExpectedManifest} : undef;
$strComment =
@@ -188,19 +186,12 @@ sub backupBegin
(defined($$oParam{bStandby}) && $$oParam{bStandby} ? " --backup-standby" : '') .
(defined($oParam->{strRepoType}) ? " --repo1-type=$oParam->{strRepoType}" : '') .
($strType ne 'incr' ? " --type=${strType}" : '') .
' --stanza=' . (defined($oParam->{strStanza}) ? $oParam->{strStanza} : $self->stanza()) . ' backup' .
(defined($strTest) ? " --test --test-delay=${fTestDelay} --test-point=" . lc($strTest) . '=y' : ''),
' --stanza=' . (defined($oParam->{strStanza}) ? $oParam->{strStanza} : $self->stanza()) . ' backup',
{strComment => $strComment, iExpectedExitStatus => $$oParam{iExpectedExitStatus},
oLogTest => $self->{oLogTest}, bLogOutput => $self->synthetic()});
$oExecuteBackup->begin();
# Return at the test point if one was defined
if (defined($strTest))
{
$oExecuteBackup->end($strTest);
}
# Return from function and log return values if any
return logDebugReturn
(
@@ -863,8 +863,7 @@ sub run
\%oManifest, MANIFEST_TARGET_PGTBLSPC . '/1', DB_FILE_PREFIX_TMP . '/' . DB_FILE_PREFIX_TMP . '.1', 'IGNORE');
}
my $strBackup = $oHostBackup->backup(
$strType, 'add tablespace 1', {oExpectedManifest => \%oManifest, strOptionalParam => '--test'});
my $strBackup = $oHostBackup->backup($strType, 'add tablespace 1', {oExpectedManifest => \%oManifest});
# Resume Incr Backup
#---------------------------------------------------------------------------------------------------------------------------