1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-11-29 22:28:02 +02:00

Remove process-max option.

Parallelism is now tested in a more targeted manner and the high level option is no longer needed.
This commit is contained in:
David Steele
2017-06-21 19:21:16 -04:00
parent 2348693389
commit 8b9965abcb
12 changed files with 36 additions and 79 deletions

View File

@@ -47,4 +47,4 @@ install:
- pgbackrest/test/test.pl --vm-build --vm=${PGB_TEST_VM?} - pgbackrest/test/test.pl --vm-build --vm=${PGB_TEST_VM?}
script: script:
- pgbackrest/test/test.pl --vm-host=u14 --vm=${PGB_TEST_VM?} ${PGB_TEST_PARAM?} - pgbackrest/test/test.pl --vm-max=2 --vm-host=u14 --vm=${PGB_TEST_VM?} ${PGB_TEST_PARAM?}

View File

@@ -216,6 +216,10 @@
<release-item> <release-item>
<p>Remove <proper>Ubuntu 12.04</proper> from CI now that it is EOL (it can still be run manually).</p> <p>Remove <proper>Ubuntu 12.04</proper> from CI now that it is EOL (it can still be run manually).</p>
</release-item> </release-item>
<release-item>
<p>Remove <setting>process-max</setting> option. Parallelism is now tested in a more targeted manner and the high level option is no longer needed.</p>
</release-item>
</release-refactor-list> </release-refactor-list>
</release-test-list> </release-test-list>
</release> </release>

View File

@@ -131,7 +131,7 @@ sub process
" - " . BACKREST_EXE . "/test/test.pl --vm-build --vm=\${PGB_TEST_VM?}\n" . " - " . BACKREST_EXE . "/test/test.pl --vm-build --vm=\${PGB_TEST_VM?}\n" .
"\n" . "\n" .
"script:\n" . "script:\n" .
" - " . BACKREST_EXE . "/test/test.pl --vm-host=u14 --vm=\${PGB_TEST_VM?} \${PGB_TEST_PARAM?}\n"; " - " . BACKREST_EXE . "/test/test.pl --vm-max=2 --vm-host=u14 --vm=\${PGB_TEST_VM?} \${PGB_TEST_PARAM?}\n";
$self->{oStorage}->put('.travis.yml', $strConfig); $self->{oStorage}->put('.travis.yml', $strConfig);

View File

@@ -43,9 +43,6 @@ use constant TESTDEF_EXPECT => 'expect';
# Determines if each run in a test will be run in a new container # Determines if each run in a test will be run in a new container
use constant TESTDEF_INDIVIDUAL => 'individual'; use constant TESTDEF_INDIVIDUAL => 'individual';
push @EXPORT, qw(TESTDEF_INDIVIDUAL); push @EXPORT, qw(TESTDEF_INDIVIDUAL);
# Determines if the test will be run with multiple processes
use constant TESTDEF_PROCESS => 'process';
push @EXPORT, qw(TESTDEF_PROCESS);
# Total runs in the test # Total runs in the test
use constant TESTDEF_TOTAL => 'total'; use constant TESTDEF_TOTAL => 'total';
push @EXPORT, qw(TESTDEF_TOTAL); push @EXPORT, qw(TESTDEF_TOTAL);
@@ -453,7 +450,7 @@ foreach my $hModule (@{$oTestDef->{&TESTDEF_MODULE}})
# Resolve variables that can be set in the module or the test # Resolve variables that can be set in the module or the test
foreach my $strVar ( foreach my $strVar (
TESTDEF_CONTAINER, TESTDEF_EXPECT, TESTDEF_PROCESS, TESTDEF_DB, TESTDEF_INDIVIDUAL, TESTDEF_VM) TESTDEF_CONTAINER, TESTDEF_EXPECT, TESTDEF_DB, TESTDEF_INDIVIDUAL, TESTDEF_VM)
{ {
$hTestDefHash->{$strModule}{$strTest}{$strVar} = coalesce( $hTestDefHash->{$strModule}{$strTest}{$strVar} = coalesce(
$hModuleTest->{$strVar}, $hModule->{$strVar}, $strVar eq TESTDEF_VM ? undef : false); $hModuleTest->{$strVar}, $hModule->{$strVar}, $strVar eq TESTDEF_VM ? undef : false);

View File

@@ -121,7 +121,6 @@ sub run
', module=' . $self->{oTest}->{&TEST_MODULE} . ', module=' . $self->{oTest}->{&TEST_MODULE} .
', test=' . $self->{oTest}->{&TEST_NAME} . ', test=' . $self->{oTest}->{&TEST_NAME} .
(defined($self->{oTest}->{&TEST_RUN}) ? ', run=' . join(',', @{$self->{oTest}->{&TEST_RUN}}) : '') . (defined($self->{oTest}->{&TEST_RUN}) ? ', run=' . join(',', @{$self->{oTest}->{&TEST_RUN}}) : '') .
(defined($self->{oTest}->{&TEST_PROCESS}) ? ', process-max=' . $self->{oTest}->{&TEST_PROCESS} : '') .
(defined($self->{oTest}->{&TEST_DB}) ? ', db=' . $self->{oTest}->{&TEST_DB} : '') . (defined($self->{oTest}->{&TEST_DB}) ? ', db=' . $self->{oTest}->{&TEST_DB} : '') .
($self->{iTry} > 1 ? ' (retry ' . ($self->{iTry} - 1) . ')' : ''); ($self->{iTry} > 1 ? ' (retry ' . ($self->{iTry} - 1) . ')' : '');
@@ -177,7 +176,6 @@ sub run
' --test=' . $self->{oTest}->{&TEST_NAME} . ' --test=' . $self->{oTest}->{&TEST_NAME} .
$strCommandRunParam . $strCommandRunParam .
(defined($self->{oTest}->{&TEST_DB}) ? ' --db-version=' . $self->{oTest}->{&TEST_DB} : '') . (defined($self->{oTest}->{&TEST_DB}) ? ' --db-version=' . $self->{oTest}->{&TEST_DB} : '') .
(defined($self->{oTest}->{&TEST_PROCESS}) ? ' --process-max=' . $self->{oTest}->{&TEST_PROCESS} : '') .
($self->{strLogLevel} ne lc(INFO) ? " --log-level=$self->{strLogLevel}" : '') . ($self->{strLogLevel} ne lc(INFO) ? " --log-level=$self->{strLogLevel}" : '') .
' --pgsql-bin=' . $self->{oTest}->{&TEST_PGSQL_BIN} . ' --pgsql-bin=' . $self->{oTest}->{&TEST_PGSQL_BIN} .
($self->{bLogForce} ? ' --log-force' : '') . ($self->{bLogForce} ? ' --log-force' : '') .

View File

@@ -33,8 +33,6 @@ use constant TEST_PGSQL_BIN => 'pgsql-bi
push @EXPORT, qw(TEST_PGSQL_BIN); push @EXPORT, qw(TEST_PGSQL_BIN);
use constant TEST_RUN => 'run'; use constant TEST_RUN => 'run';
push @EXPORT, qw(TEST_RUN); push @EXPORT, qw(TEST_RUN);
use constant TEST_PROCESS => 'process';
push @EXPORT, qw(TEST_PROCESS);
use constant TEST_VM => 'os'; use constant TEST_VM => 'os';
push @EXPORT, qw(TEST_VM); push @EXPORT, qw(TEST_VM);
use constant TEST_PERL_ARCH_PATH => VMDEF_PERL_ARCH_PATH; use constant TEST_PERL_ARCH_PATH => VMDEF_PERL_ARCH_PATH;
@@ -50,7 +48,6 @@ sub testListGet
my $stryModuleTest = shift; my $stryModuleTest = shift;
my $iyModuleTestRun = shift; my $iyModuleTestRun = shift;
my $strDbVersion = shift; my $strDbVersion = shift;
my $iProcessMax = shift;
my $bCoverageOnly = shift; my $bCoverageOnly = shift;
my $oyVm = vmGet(); my $oyVm = vmGet();
@@ -128,16 +125,6 @@ sub testListGet
# Skip this run if only coverage tests are requested and this test does not provide coverage # Skip this run if only coverage tests are requested and this test does not provide coverage
next if ($bCoverageOnly && !defined($hTest->{&TESTDEF_COVERAGE})); next if ($bCoverageOnly && !defined($hTest->{&TESTDEF_COVERAGE}));
my $iyProcessMax = [defined($iProcessMax) ? $iProcessMax : 1];
if (defined($hTest->{&TESTDEF_PROCESS}) && $hTest->{&TESTDEF_PROCESS} &&
!defined($iProcessMax) && $bFirstDbVersion)
{
$iyProcessMax = [1, 4];
}
foreach my $iProcessTestMax (@{$iyProcessMax})
{
my $strDbVersion = $iDbVersionIdx == -1 ? undef : my $strDbVersion = $iDbVersionIdx == -1 ? undef :
${$$oyVm{$strTestOS}{$strDbVersionKey}}[$iDbVersionIdx]; ${$$oyVm{$strTestOS}{$strDbVersionKey}}[$iDbVersionIdx];
@@ -164,13 +151,11 @@ sub testListGet
&TEST_RUN => &TEST_RUN =>
$iTestRunIdx == -1 ? (@{$iyModuleTestRun} == 0 ? undef : $iyModuleTestRun) : $iTestRunIdx == -1 ? (@{$iyModuleTestRun} == 0 ? undef : $iyModuleTestRun) :
[$iTestRunIdx], [$iTestRunIdx],
&TEST_PROCESS => $iProcessTestMax,
&TEST_DB => $strDbVersion &TEST_DB => $strDbVersion
}; };
push(@{$oyTestRun}, $oTestRun); push(@{$oyTestRun}, $oTestRun);
} }
}
$bFirstDbVersion = false; $bFirstDbVersion = false;
} }

View File

@@ -119,7 +119,6 @@ sub process
$self->{strModule}, $self->{strModule},
$self->{strModuleTest}, $self->{strModuleTest},
$self->{iyModuleTestRun}, $self->{iyModuleTestRun},
$self->{iProcessMax},
$self->{bOutput}, $self->{bOutput},
$self->{bDryRun}, $self->{bDryRun},
$self->{bCleanup}, $self->{bCleanup},
@@ -141,7 +140,6 @@ sub process
{name => 'strModule'}, {name => 'strModule'},
{name => 'strModuleTest'}, {name => 'strModuleTest'},
{name => 'iModuleTestRun', required => false}, {name => 'iModuleTestRun', required => false},
{name => 'iProcessMax'},
{name => 'bOutput'}, {name => 'bOutput'},
{name => 'bDryRun'}, {name => 'bDryRun'},
{name => 'bCleanup'}, {name => 'bCleanup'},
@@ -595,7 +593,6 @@ sub moduleTest {return shift->{strModuleTest}}
sub pgBinPath {return shift->{strPgBinPath}} sub pgBinPath {return shift->{strPgBinPath}}
sub pgUser {return shift->{strPgUser}} sub pgUser {return shift->{strPgUser}}
sub pgVersion {return shift->{strPgVersion}} sub pgVersion {return shift->{strPgVersion}}
sub processMax {return shift->{iProcessMax}}
sub runCurrent {return shift->{iRun}} sub runCurrent {return shift->{iRun}}
sub stanza {return 'db'} sub stanza {return 'db'}
sub testPath {return shift->{strTestPath}} sub testPath {return shift->{strTestPath}}

View File

@@ -936,11 +936,6 @@ sub configCreate
$oParamHash{&CONFIG_SECTION_GLOBAL}{&OPTION_PROTOCOL_TIMEOUT} = 60; $oParamHash{&CONFIG_SECTION_GLOBAL}{&OPTION_PROTOCOL_TIMEOUT} = 60;
$oParamHash{&CONFIG_SECTION_GLOBAL}{&OPTION_DB_TIMEOUT} = 45; $oParamHash{&CONFIG_SECTION_GLOBAL}{&OPTION_DB_TIMEOUT} = 45;
if ($self->processMax() > 1)
{
$oParamHash{&CONFIG_SECTION_GLOBAL}{&OPTION_PROCESS_MAX} = $self->processMax();
}
if (defined($$oParam{bCompress}) && !$$oParam{bCompress}) if (defined($$oParam{bCompress}) && !$$oParam{bCompress})
{ {
$oParamHash{&CONFIG_SECTION_GLOBAL}{&OPTION_COMPRESS} = 'n'; $oParamHash{&CONFIG_SECTION_GLOBAL}{&OPTION_COMPRESS} = 'n';
@@ -1330,7 +1325,6 @@ sub lockPath {return shift->{strLockPath}}
sub logPath {return shift->{strLogPath}} sub logPath {return shift->{strLogPath}}
sub repoPath {return shift->{strRepoPath}} sub repoPath {return shift->{strRepoPath}}
sub stanza {return testRunGet()->stanza()} sub stanza {return testRunGet()->stanza()}
sub processMax {return testRunGet()->processMax()}
sub synthetic {return shift->{bSynthetic}} sub synthetic {return shift->{bSynthetic}}
1; 1;

View File

@@ -64,13 +64,7 @@ sub run
foreach my $bRemote ($bS3 ? (true) : (false, true)) foreach my $bRemote ($bS3 ? (true) : (false, true))
{ {
# Increment the run, log, and decide whether this unit test should be run # Increment the run, log, and decide whether this unit test should be run
if (!$self->begin("rmt ${bRemote}, s3 ${bS3}", $self->processMax() == 1)) {next} if (!$self->begin("rmt ${bRemote}, s3 ${bS3}")) {next}
if ($bS3 && $self->processMax() != 1)
{
&log(INFO, 'skipped - no need to run multi-process tests on s3');
next;
}
# Create hosts, file object, and config # Create hosts, file object, and config
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup, $oHostS3) = $self->setup( my ($oHostDbMaster, $oHostDbStandby, $oHostBackup, $oHostS3) = $self->setup(

View File

@@ -84,8 +84,7 @@ sub run
foreach my $bRemote ($bS3 ? (true) : (false, true)) foreach my $bRemote ($bS3 ? (true) : (false, true))
{ {
# Increment the run, log, and decide whether this unit test should be run # Increment the run, log, and decide whether this unit test should be run
if (!$self->begin( if (!$self->begin("rmt ${bRemote}, s3 ${bS3}")) {next}
"rmt ${bRemote}, s3 ${bS3}", $self->processMax() == 1)) {next}
# Create hosts, file object, and config # Create hosts, file object, and config
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup) = $self->setup( my ($oHostDbMaster, $oHostDbStandby, $oHostBackup) = $self->setup(

View File

@@ -60,7 +60,7 @@ sub run
# Increment the run, log, and decide whether this unit test should be run # Increment the run, log, and decide whether this unit test should be run
next if (!$self->begin( next if (!$self->begin(
"bkp ${bHostBackup}, sby ${bHostStandby}, dst ${strBackupDestination}, cmp ${bCompress}, s3 ${bS3}", "bkp ${bHostBackup}, sby ${bHostStandby}, dst ${strBackupDestination}, cmp ${bCompress}, s3 ${bS3}",
$self->processMax() == 1 && $self->pgVersion() eq PG_VERSION_96)); $self->pgVersion() eq PG_VERSION_96));
# Skip when s3 and host backup tests when there is more than one version of pg being tested and this is not the last one # Skip when s3 and host backup tests when there is more than one version of pg being tested and this is not the last one
my $hyVm = vmGet(); my $hyVm = vmGet();

View File

@@ -66,7 +66,6 @@ test.pl [options]
--module test module to execute --module test module to execute
--test execute the specified test in a module --test execute the specified test in a module
--run execute only the specified test run --run execute only the specified test run
--process-max max processes to run for compression/transfer (default 1)
--dry-run show only the tests that would be executed but don't execute them --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 --no-cleanup don't cleaup after the last test is complete - useful for debugging
--db-version version of postgres to test (all, defaults to minimal) --db-version version of postgres to test (all, defaults to minimal)
@@ -106,7 +105,6 @@ my $bVmOut = false;
my @stryModule; my @stryModule;
my @stryModuleTest; my @stryModuleTest;
my @iyModuleTestRun; my @iyModuleTestRun;
my $iProcessMax = undef;
my $iVmMax = 1; my $iVmMax = 1;
my $iVmId = undef; my $iVmId = undef;
my $bDryRun = false; my $bDryRun = false;
@@ -146,7 +144,6 @@ GetOptions ('q|quiet' => \$bQuiet,
'module=s@' => \@stryModule, 'module=s@' => \@stryModule,
'test=s@' => \@stryModuleTest, 'test=s@' => \@stryModuleTest,
'run=s@' => \@iyModuleTestRun, 'run=s@' => \@iyModuleTestRun,
'process-max=s' => \$iProcessMax,
'vm-id=s' => \$iVmId, 'vm-id=s' => \$iVmId,
'vm-max=s' => \$iVmMax, 'vm-max=s' => \$iVmMax,
'dry-run' => \$bDryRun, 'dry-run' => \$bDryRun,
@@ -197,7 +194,6 @@ eval
$bNoLint = true; $bNoLint = true;
$bSmart = true; $bSmart = true;
$bNoPackage = true; $bNoPackage = true;
$iProcessMax = 1;
} }
################################################################################################################################ ################################################################################################################################
@@ -208,7 +204,6 @@ eval
$bNoLint = true; $bNoLint = true;
$bSmart = true; $bSmart = true;
$bNoPackage = true; $bNoPackage = true;
$iProcessMax = 1;
$strVm = VM_CO7; $strVm = VM_CO7;
$strDbVersion = '9.6'; $strDbVersion = '9.6';
$bLogForce = true; $bLogForce = true;
@@ -238,12 +233,6 @@ eval
confess "Only one --test can be provided when --run is specified"; confess "Only one --test can be provided when --run is specified";
} }
# Check process total
if (defined($iProcessMax) && ($iProcessMax < 1 || $iProcessMax > OPTION_DEFAULT_PROCESS_MAX_MAX))
{
confess 'process-max must be between 1 and ' . OPTION_DEFAULT_PROCESS_MAX_MAX;
}
# Set test path if not expicitly set # Set test path if not expicitly set
if (!defined($strTestPath)) if (!defined($strTestPath))
{ {
@@ -611,7 +600,7 @@ eval
# Determine which tests to run # Determine which tests to run
#----------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------
my $oyTestRun = testListGet( my $oyTestRun = testListGet(
$strVm, \@stryModule, \@stryModuleTest, \@iyModuleTestRun, $strDbVersion, $iProcessMax, $bCoverageOnly); $strVm, \@stryModule, \@stryModuleTest, \@iyModuleTestRun, $strDbVersion, $bCoverageOnly);
if (@{$oyTestRun} == 0) if (@{$oyTestRun} == 0)
{ {
@@ -863,7 +852,7 @@ eval
$strDbVersion ne 'minimal' ? $strPgSqlBin: undef, # Db bin path $strDbVersion ne 'minimal' ? $strPgSqlBin: undef, # Db bin path
$strDbVersion ne 'minimal' ? $strDbVersion: undef, # Db version $strDbVersion ne 'minimal' ? $strDbVersion: undef, # Db version
$stryModule[0], $stryModuleTest[0], \@iyModuleTestRun, # Module info $stryModule[0], $stryModuleTest[0], \@iyModuleTestRun, # Module info
$iProcessMax, $bVmOut, $bDryRun, $bNoCleanup, $bLogForce, # Test options $bVmOut, $bDryRun, $bNoCleanup, $bLogForce, # Test options
TEST_USER, BACKREST_USER, TEST_GROUP); # User/group info TEST_USER, BACKREST_USER, TEST_GROUP); # User/group info
if (!$bNoCleanup) if (!$bNoCleanup)