1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-18 04:58:51 +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?}
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>
<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>
<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-test-list>
</release>

View File

@ -131,7 +131,7 @@ sub process
" - " . BACKREST_EXE . "/test/test.pl --vm-build --vm=\${PGB_TEST_VM?}\n" .
"\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);

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
use constant TESTDEF_INDIVIDUAL => '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
use constant TESTDEF_TOTAL => '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
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(
$hModuleTest->{$strVar}, $hModule->{$strVar}, $strVar eq TESTDEF_VM ? undef : false);

View File

@ -121,7 +121,6 @@ sub run
', module=' . $self->{oTest}->{&TEST_MODULE} .
', test=' . $self->{oTest}->{&TEST_NAME} .
(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} : '') .
($self->{iTry} > 1 ? ' (retry ' . ($self->{iTry} - 1) . ')' : '');
@ -177,7 +176,6 @@ sub run
' --test=' . $self->{oTest}->{&TEST_NAME} .
$strCommandRunParam .
(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}" : '') .
' --pgsql-bin=' . $self->{oTest}->{&TEST_PGSQL_BIN} .
($self->{bLogForce} ? ' --log-force' : '') .

View File

@ -33,8 +33,6 @@ use constant TEST_PGSQL_BIN => 'pgsql-bi
push @EXPORT, qw(TEST_PGSQL_BIN);
use constant TEST_RUN => 'run';
push @EXPORT, qw(TEST_RUN);
use constant TEST_PROCESS => 'process';
push @EXPORT, qw(TEST_PROCESS);
use constant TEST_VM => 'os';
push @EXPORT, qw(TEST_VM);
use constant TEST_PERL_ARCH_PATH => VMDEF_PERL_ARCH_PATH;
@ -50,7 +48,6 @@ sub testListGet
my $stryModuleTest = shift;
my $iyModuleTestRun = shift;
my $strDbVersion = shift;
my $iProcessMax = shift;
my $bCoverageOnly = shift;
my $oyVm = vmGet();
@ -128,48 +125,36 @@ sub testListGet
# Skip this run if only coverage tests are requested and this test does not provide coverage
next if ($bCoverageOnly && !defined($hTest->{&TESTDEF_COVERAGE}));
my $iyProcessMax = [defined($iProcessMax) ? $iProcessMax : 1];
my $strDbVersion = $iDbVersionIdx == -1 ? undef :
${$$oyVm{$strTestOS}{$strDbVersionKey}}[$iDbVersionIdx];
if (defined($hTest->{&TESTDEF_PROCESS}) && $hTest->{&TESTDEF_PROCESS} &&
!defined($iProcessMax) && $bFirstDbVersion)
my $strPgSqlBin = $$oyVm{$strTestOS}{&VMDEF_PGSQL_BIN};
if (defined($strDbVersion))
{
$iyProcessMax = [1, 4];
$strPgSqlBin =~ s/\{\[version\]\}/$strDbVersion/g;
}
else
{
$strPgSqlBin =~ s/\{\[version\]\}/9\.4/g;
}
foreach my $iProcessTestMax (@{$iyProcessMax})
my $oTestRun =
{
my $strDbVersion = $iDbVersionIdx == -1 ? undef :
${$$oyVm{$strTestOS}{$strDbVersionKey}}[$iDbVersionIdx];
&TEST_VM => $strTestOS,
&TEST_CONTAINER => defined($hTest->{&TESTDEF_CONTAINER}) ?
$hTest->{&TESTDEF_CONTAINER} : $hModule->{&TESTDEF_CONTAINER},
&TEST_PGSQL_BIN => $strPgSqlBin,
&TEST_PERL_ARCH_PATH => $$oyVm{$strTestOS}{&VMDEF_PERL_ARCH_PATH},
&TEST_MODULE => $strModule,
&TEST_NAME => $strModuleTest,
&TEST_RUN =>
$iTestRunIdx == -1 ? (@{$iyModuleTestRun} == 0 ? undef : $iyModuleTestRun) :
[$iTestRunIdx],
&TEST_DB => $strDbVersion
};
my $strPgSqlBin = $$oyVm{$strTestOS}{&VMDEF_PGSQL_BIN};
if (defined($strDbVersion))
{
$strPgSqlBin =~ s/\{\[version\]\}/$strDbVersion/g;
}
else
{
$strPgSqlBin =~ s/\{\[version\]\}/9\.4/g;
}
my $oTestRun =
{
&TEST_VM => $strTestOS,
&TEST_CONTAINER => defined($hTest->{&TESTDEF_CONTAINER}) ?
$hTest->{&TESTDEF_CONTAINER} : $hModule->{&TESTDEF_CONTAINER},
&TEST_PGSQL_BIN => $strPgSqlBin,
&TEST_PERL_ARCH_PATH => $$oyVm{$strTestOS}{&VMDEF_PERL_ARCH_PATH},
&TEST_MODULE => $strModule,
&TEST_NAME => $strModuleTest,
&TEST_RUN =>
$iTestRunIdx == -1 ? (@{$iyModuleTestRun} == 0 ? undef : $iyModuleTestRun) :
[$iTestRunIdx],
&TEST_PROCESS => $iProcessTestMax,
&TEST_DB => $strDbVersion
};
push(@{$oyTestRun}, $oTestRun);
}
push(@{$oyTestRun}, $oTestRun);
}
$bFirstDbVersion = false;

View File

@ -119,7 +119,6 @@ sub process
$self->{strModule},
$self->{strModuleTest},
$self->{iyModuleTestRun},
$self->{iProcessMax},
$self->{bOutput},
$self->{bDryRun},
$self->{bCleanup},
@ -141,7 +140,6 @@ sub process
{name => 'strModule'},
{name => 'strModuleTest'},
{name => 'iModuleTestRun', required => false},
{name => 'iProcessMax'},
{name => 'bOutput'},
{name => 'bDryRun'},
{name => 'bCleanup'},
@ -595,7 +593,6 @@ sub moduleTest {return shift->{strModuleTest}}
sub pgBinPath {return shift->{strPgBinPath}}
sub pgUser {return shift->{strPgUser}}
sub pgVersion {return shift->{strPgVersion}}
sub processMax {return shift->{iProcessMax}}
sub runCurrent {return shift->{iRun}}
sub stanza {return 'db'}
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_DB_TIMEOUT} = 45;
if ($self->processMax() > 1)
{
$oParamHash{&CONFIG_SECTION_GLOBAL}{&OPTION_PROCESS_MAX} = $self->processMax();
}
if (defined($$oParam{bCompress}) && !$$oParam{bCompress})
{
$oParamHash{&CONFIG_SECTION_GLOBAL}{&OPTION_COMPRESS} = 'n';
@ -1330,7 +1325,6 @@ sub lockPath {return shift->{strLockPath}}
sub logPath {return shift->{strLogPath}}
sub repoPath {return shift->{strRepoPath}}
sub stanza {return testRunGet()->stanza()}
sub processMax {return testRunGet()->processMax()}
sub synthetic {return shift->{bSynthetic}}
1;

View File

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

View File

@ -84,8 +84,7 @@ sub run
foreach my $bRemote ($bS3 ? (true) : (false, true))
{
# 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}
# Create hosts, file object, and config
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
next if (!$self->begin(
"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
my $hyVm = vmGet();

View File

@ -66,7 +66,6 @@ test.pl [options]
--module test module to execute
--test execute the specified test in a module
--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
--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)
@ -106,7 +105,6 @@ my $bVmOut = false;
my @stryModule;
my @stryModuleTest;
my @iyModuleTestRun;
my $iProcessMax = undef;
my $iVmMax = 1;
my $iVmId = undef;
my $bDryRun = false;
@ -146,7 +144,6 @@ GetOptions ('q|quiet' => \$bQuiet,
'module=s@' => \@stryModule,
'test=s@' => \@stryModuleTest,
'run=s@' => \@iyModuleTestRun,
'process-max=s' => \$iProcessMax,
'vm-id=s' => \$iVmId,
'vm-max=s' => \$iVmMax,
'dry-run' => \$bDryRun,
@ -197,7 +194,6 @@ eval
$bNoLint = true;
$bSmart = true;
$bNoPackage = true;
$iProcessMax = 1;
}
################################################################################################################################
@ -208,7 +204,6 @@ eval
$bNoLint = true;
$bSmart = true;
$bNoPackage = true;
$iProcessMax = 1;
$strVm = VM_CO7;
$strDbVersion = '9.6';
$bLogForce = true;
@ -238,12 +233,6 @@ eval
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
if (!defined($strTestPath))
{
@ -611,7 +600,7 @@ eval
# Determine which tests to run
#-----------------------------------------------------------------------------------------------------------------------
my $oyTestRun = testListGet(
$strVm, \@stryModule, \@stryModuleTest, \@iyModuleTestRun, $strDbVersion, $iProcessMax, $bCoverageOnly);
$strVm, \@stryModule, \@stryModuleTest, \@iyModuleTestRun, $strDbVersion, $bCoverageOnly);
if (@{$oyTestRun} == 0)
{
@ -863,7 +852,7 @@ eval
$strDbVersion ne 'minimal' ? $strPgSqlBin: undef, # Db bin path
$strDbVersion ne 'minimal' ? $strDbVersion: undef, # Db version
$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
if (!$bNoCleanup)