You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-09-16 09:06:18 +02:00
Added thread-max parameter to test.pl to allow backup threads to be specified.
This commit is contained in:
@@ -1190,6 +1190,7 @@ sub BackRestTestBackup_RestoreCompare
|
||||
sub BackRestTestBackup_Test
|
||||
{
|
||||
my $strTest = shift;
|
||||
my $iThreadMax = shift;
|
||||
|
||||
# If no test was specified, then run them all
|
||||
if (!defined($strTest))
|
||||
@@ -1213,7 +1214,6 @@ sub BackRestTestBackup_Test
|
||||
my $iArchiveMax = 3;
|
||||
my $strXlogPath = BackRestTestCommon_DbCommonPathGet() . '/pg_xlog';
|
||||
my $strArchiveTestFile = BackRestTestCommon_DataPathGet() . '/test.archive.bin';
|
||||
my $iThreadMax = 4;
|
||||
|
||||
# Print test banner
|
||||
&log(INFO, 'BACKUP MODULE ******************************************************************');
|
||||
|
11
test/test.pl
11
test/test.pl
@@ -40,6 +40,7 @@ test.pl [options]
|
||||
--module test module to execute:
|
||||
--module-test execute the specified test in a module
|
||||
--module-test-run execute only the specified test run
|
||||
--thread-max max threads to run for backup/restore (default 4)
|
||||
--dry-run show only the tests that would be executed but don't execute them
|
||||
--no-cleanup don't cleaup after the last test is complete - useful for debugging
|
||||
--infinite repeat selected tests forever
|
||||
@@ -62,6 +63,7 @@ my $strLogLevel = 'info'; # Log level for tests
|
||||
my $strModule = 'all';
|
||||
my $strModuleTest = 'all';
|
||||
my $iModuleTestRun = undef;
|
||||
my $iThreadMax = 4;
|
||||
my $bDryRun = false;
|
||||
my $bNoCleanup = false;
|
||||
my $strPgSqlBin;
|
||||
@@ -80,6 +82,7 @@ GetOptions ('q|quiet' => \$bQuiet,
|
||||
'module=s' => \$strModule,
|
||||
'module-test=s' => \$strModuleTest,
|
||||
'module-test-run=s' => \$iModuleTestRun,
|
||||
'thread-max=s' => \$iThreadMax,
|
||||
'dry-run' => \$bDryRun,
|
||||
'no-cleanup' => \$bNoCleanup,
|
||||
'infinite' => \$bInfinite)
|
||||
@@ -149,6 +152,12 @@ if (!defined($strPgSqlBin))
|
||||
}
|
||||
}
|
||||
|
||||
# Check thread total
|
||||
if ($iThreadMax < 1 || $iThreadMax > 32)
|
||||
{
|
||||
confess 'thread-max must be between 1 and 32';
|
||||
}
|
||||
|
||||
####################################################################################################################################
|
||||
# Make sure version number matches in README.md and VERSION
|
||||
####################################################################################################################################
|
||||
@@ -227,7 +236,7 @@ do
|
||||
|
||||
if ($strModule eq 'all' || $strModule eq 'backup')
|
||||
{
|
||||
BackRestTestBackup_Test($strModuleTest);
|
||||
BackRestTestBackup_Test($strModuleTest, $iThreadMax);
|
||||
}
|
||||
}
|
||||
while ($bInfinite);
|
||||
|
Reference in New Issue
Block a user