pgbackrest.git / summary / log / commit / refs

commit    95bbc8ad544cac4a95a90f94de2ca8856811dc37
Author:   David Steele <david@pgmasters.net>
Date:     Fri Jul 29 22:02:16 2016 +0000

    Fixed an issue where multi-threaded tests were not being run when requested.


doc/xml/release.xml | 4 ++++ test/lib/pgBackRestTest/Backup/BackupCommonTest.pm | 8 +++----- test/lib/pgBackRestTest/Backup/BackupTest.pm | 9 +++++---- .../pgBackRestTest/Backup/Common/HostBackupTest.pm | 6 ++---- test/lib/pgBackRestTest/Config/ConfigTest.pm | 1 - test/lib/pgBackRestTest/File/FileTest.pm | 1 - test/lib/pgBackRestTest/Help/HelpTest.pm | 1 - test/test.pl | 20 ++++++++++---------- 8 files changed, 24 insertions(+), 26 deletions(-) diff --git a/doc/xml/release.xml b/doc/xml/release.xml index 046275d1f..0887d502e 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -193,6 +193,10 @@ <release-item> <p>Fixed a version checking issue in <file>test.pl</file>.</p> </release-item> + + <release-item> + <p>Fixed an issue where multi-threaded tests were not being run when requested.</p> + </release-item> </release-bug-list> </release-test-list> </release> diff --git a/test/lib/pgBackRestTest/Backup/BackupCommonTest.pm b/test/lib/pgBackRestTest/Backup/BackupCommonTest.pm index 83b2bc803..5ca785c6e 100644 --- a/test/lib/pgBackRestTest/Backup/BackupCommonTest.pm +++ b/test/lib/pgBackRestTest/Backup/BackupCommonTest.pm @@ -82,8 +82,7 @@ sub backupTestSetup $oHostDbMaster->configCreate( ($bRemote ? $oHostBackup : undef), $$oConfigParam{bCompress}, - $bRemote ? undef : $$oConfigParam{bHardLink}, # hardlink - undef, # thread-max + $bRemote ? undef : $$oConfigParam{bHardLink}, $$oConfigParam{bArchiveAsync}, undef); @@ -92,9 +91,8 @@ sub backupTestSetup { $oHostBackup->configCreate( $oHostDbMaster, - $$oConfigParam{bCompress}, # compress - $$oConfigParam{bHardLink}, # hardlink - $$oConfigParam{iThreadMax}); # thread-max + $$oConfigParam{bCompress}, + $$oConfigParam{bHardLink}); } return $oHostDbMaster, $oHostBackup, $oFile; diff --git a/test/lib/pgBackRestTest/Backup/BackupTest.pm b/test/lib/pgBackRestTest/Backup/BackupTest.pm index a3b5a3070..e69f6f2e6 100755 --- a/test/lib/pgBackRestTest/Backup/BackupTest.pm +++ b/test/lib/pgBackRestTest/Backup/BackupTest.pm @@ -110,7 +110,6 @@ sub archiveCheck sub backupTestRun { my $strTest = shift; - my $iThreadMax = shift; my $bVmOut = shift; # If no test was specified, then run them all @@ -122,6 +121,7 @@ sub backupTestRun # Setup global variables my $oHostGroup = hostGroupGet(); my $strTestPath = $oHostGroup->paramGet(HOST_PARAM_TEST_PATH); + my $iThreadMax = $oHostGroup->paramGet(HOST_PARAM_THREAD_MAX); # Setup test variables my $iRun; @@ -678,7 +678,7 @@ sub backupTestRun # Create hosts, file object, and config my ($oHostDbMaster, $oHostBackup, $oFile) = backupTestSetup( - $bRemote, true, $oLogTest, {bCompress => $bCompress, bHardLink => $bHardLink, iThreadMax => $iThreadMax}); + $bRemote, true, $oLogTest, {bCompress => $bCompress, bHardLink => $bHardLink}); # Determine if this is a neutral test, i.e. we only want to do it once for local and once for remote. Neutral means # that options such as compression and hardlinks are disabled @@ -853,7 +853,7 @@ sub backupTestRun my $oExecuteBackup = $oHostBackup->backupBegin( $strType, 'abort backup - local', {oExpectedManifest => \%oManifest, strTest => TEST_BACKUP_START, fTestDelay => 5, - iExpectedExitStatus => ERROR_TERM}); + iExpectedExitStatus => $bRemote && $iThreadMax > 1 ? ERROR_STOP : ERROR_TERM}); $oHostDbMaster->stop({bForce => true}); @@ -1548,7 +1548,8 @@ sub backupTestRun # Create hosts, file object, and config my ($oHostDbMaster, $oHostBackup, $oFile) = backupTestSetup( $bRemote, false, undef, - {bCompress => $bCompress, iThreadMax => $iThreadMax, bArchiveAsync => $bArchiveAsync}); + {bCompress => $bCompress, bArchiveAsync => $bArchiveAsync}); + # For the 'fail on missing archive.info file' test, the archive.info file must not be found so set archive invalid. $oHostDbMaster->clusterCreate({bArchiveInvalid => true}); diff --git a/test/lib/pgBackRestTest/Backup/Common/HostBackupTest.pm b/test/lib/pgBackRestTest/Backup/Common/HostBackupTest.pm index 1295b3293..6decd395a 100644 --- a/test/lib/pgBackRestTest/Backup/Common/HostBackupTest.pm +++ b/test/lib/pgBackRestTest/Backup/Common/HostBackupTest.pm @@ -13,7 +13,6 @@ use Carp qw(confess); use Exporter qw(import); our @EXPORT = qw(); - use Storable qw(dclone); use pgBackRest::Common::Exception; @@ -684,7 +683,6 @@ sub configCreate my $oHostRemote = shift; my $bCompress = shift; my $bHardlink = shift; - my $iThreadMax = shift; my $bArchiveAsync = shift; my $bCompressAsync = shift; @@ -753,9 +751,9 @@ sub configCreate $oParamHash{&CONFIG_SECTION_GLOBAL}{&OPTION_CONFIG_REMOTE} = $oHostRemote->backrestConfig(); } - if (defined($iThreadMax) && $iThreadMax > 1) + if ($self->threadMax() > 1) { - $oParamHash{&CONFIG_SECTION_GLOBAL}{&OPTION_THREAD_MAX} = $iThreadMax; + $oParamHash{&CONFIG_SECTION_GLOBAL}{&OPTION_THREAD_MAX} = $self->threadMax(); } if ($self->nameTest(HOST_BACKUP) || !defined($oHostRemote)) diff --git a/test/lib/pgBackRestTest/Config/ConfigTest.pm b/test/lib/pgBackRestTest/Config/ConfigTest.pm index 6eddcc1a4..d36a0900c 100755 --- a/test/lib/pgBackRestTest/Config/ConfigTest.pm +++ b/test/lib/pgBackRestTest/Config/ConfigTest.pm @@ -234,7 +234,6 @@ sub optionTestExpect sub configTestRun { my $strTest = shift; - my $iThreadMax = shift; my $bVmOut = shift; # Setup test variables diff --git a/test/lib/pgBackRestTest/File/FileTest.pm b/test/lib/pgBackRestTest/File/FileTest.pm index 184e5b4f0..fbf37365c 100755 --- a/test/lib/pgBackRestTest/File/FileTest.pm +++ b/test/lib/pgBackRestTest/File/FileTest.pm @@ -71,7 +71,6 @@ sub fileTestSetup sub fileTestRun { my $strTest = shift; - my $iThreadMax = shift; my $bVmOut = shift; # If no test was specified, then run them all diff --git a/test/lib/pgBackRestTest/Help/HelpTest.pm b/test/lib/pgBackRestTest/Help/HelpTest.pm index 0a2a09af1..428629f2d 100644 --- a/test/lib/pgBackRestTest/Help/HelpTest.pm +++ b/test/lib/pgBackRestTest/Help/HelpTest.pm @@ -38,7 +38,6 @@ sub helpExecute sub helpTestRun { my $strTest = shift; - my $iThreadMax = shift; my $bVmOut = shift; # Setup test variables diff --git a/test/test.pl b/test/test.pl index e31d113f9..73614198d 100755 --- a/test/test.pl +++ b/test/test.pl @@ -518,24 +518,24 @@ eval &log(INFO, "TESTING psql-bin = $strPgSqlBin\n"); } - if ($strModule eq 'all' || $strModule eq 'help') - { - helpTestRun($strModuleTest, undef, $bVmOut); - } + if ($strModule eq 'all' || $strModule eq 'help') + { + helpTestRun($strModuleTest, $bVmOut); + } - if ($strModule eq 'all' || $strModule eq 'config') - { - configTestRun($strModuleTest, undef, $bVmOut); - } + if ($strModule eq 'all' || $strModule eq 'config') + { + configTestRun($strModuleTest, $bVmOut); + } if ($strModule eq 'all' || $strModule eq 'file') { - fileTestRun($strModuleTest, undef, $bVmOut); + fileTestRun($strModuleTest, $bVmOut); } if ($strModule eq 'all' || $strModule eq 'backup') { - backupTestRun($strModuleTest, 1, $bVmOut); + backupTestRun($strModuleTest, $bVmOut); } } [parent: 6e9d5f5bd31c]