diff --git a/.travis.yml b/.travis.yml index 718800ba7..98d5c1c38 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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?} diff --git a/doc/xml/release.xml b/doc/xml/release.xml index 647c8ae47..465f16f4a 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -216,6 +216,10 @@

Remove Ubuntu 12.04 from CI now that it is EOL (it can still be run manually).

+ + +

Remove process-max option. Parallelism is now tested in a more targeted manner and the high level option is no longer needed.

+
diff --git a/test/lib/pgBackRestTest/Common/CiTest.pm b/test/lib/pgBackRestTest/Common/CiTest.pm index 4c7b13d81..7706a8c58 100644 --- a/test/lib/pgBackRestTest/Common/CiTest.pm +++ b/test/lib/pgBackRestTest/Common/CiTest.pm @@ -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); diff --git a/test/lib/pgBackRestTest/Common/DefineTest.pm b/test/lib/pgBackRestTest/Common/DefineTest.pm index 50143bec5..92f602231 100644 --- a/test/lib/pgBackRestTest/Common/DefineTest.pm +++ b/test/lib/pgBackRestTest/Common/DefineTest.pm @@ -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); diff --git a/test/lib/pgBackRestTest/Common/JobTest.pm b/test/lib/pgBackRestTest/Common/JobTest.pm index 24b4d327c..390b9e968 100644 --- a/test/lib/pgBackRestTest/Common/JobTest.pm +++ b/test/lib/pgBackRestTest/Common/JobTest.pm @@ -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' : '') . diff --git a/test/lib/pgBackRestTest/Common/ListTest.pm b/test/lib/pgBackRestTest/Common/ListTest.pm index a7b55d68a..e269eea19 100644 --- a/test/lib/pgBackRestTest/Common/ListTest.pm +++ b/test/lib/pgBackRestTest/Common/ListTest.pm @@ -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; diff --git a/test/lib/pgBackRestTest/Common/RunTest.pm b/test/lib/pgBackRestTest/Common/RunTest.pm index 29aca42c6..d14d56ebc 100644 --- a/test/lib/pgBackRestTest/Common/RunTest.pm +++ b/test/lib/pgBackRestTest/Common/RunTest.pm @@ -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}} diff --git a/test/lib/pgBackRestTest/Env/Host/HostBackupTest.pm b/test/lib/pgBackRestTest/Env/Host/HostBackupTest.pm index 1f6b911df..e88143c12 100644 --- a/test/lib/pgBackRestTest/Env/Host/HostBackupTest.pm +++ b/test/lib/pgBackRestTest/Env/Host/HostBackupTest.pm @@ -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; diff --git a/test/lib/pgBackRestTest/Module/Mock/MockAllTest.pm b/test/lib/pgBackRestTest/Module/Mock/MockAllTest.pm index b8ddef899..12405987a 100644 --- a/test/lib/pgBackRestTest/Module/Mock/MockAllTest.pm +++ b/test/lib/pgBackRestTest/Module/Mock/MockAllTest.pm @@ -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( diff --git a/test/lib/pgBackRestTest/Module/Mock/MockArchiveTest.pm b/test/lib/pgBackRestTest/Module/Mock/MockArchiveTest.pm index 65b7a62b1..315364e57 100644 --- a/test/lib/pgBackRestTest/Module/Mock/MockArchiveTest.pm +++ b/test/lib/pgBackRestTest/Module/Mock/MockArchiveTest.pm @@ -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( diff --git a/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm b/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm index 25fb322fa..9a097b8fd 100644 --- a/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm +++ b/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm @@ -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(); diff --git a/test/test.pl b/test/test.pl index 739fc2e7d..8a0cf052d 100755 --- a/test/test.pl +++ b/test/test.pl @@ -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)