From ac1574448e8b6e2a6b6c3690f3998aac35e4d40d Mon Sep 17 00:00:00 2001 From: David Steele Date: Thu, 10 Aug 2017 18:11:29 -0400 Subject: [PATCH] Changed log test order to ignore unimportant log errors while shutting down PostgreSQL. --- doc/xml/release.xml | 10 ++++++++++ test/lib/pgBackRestTest/Env/Host/HostDbTest.pm | 14 +++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/doc/xml/release.xml b/doc/xml/release.xml index b38e458ff..010d6ad00 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -163,6 +163,16 @@ + + + + +

Changed log test order to ignore unimportant log errors while shutting down .

+
+
+
+
+ diff --git a/test/lib/pgBackRestTest/Env/Host/HostDbTest.pm b/test/lib/pgBackRestTest/Env/Host/HostDbTest.pm index fc470d102..786b13956 100644 --- a/test/lib/pgBackRestTest/Env/Host/HostDbTest.pm +++ b/test/lib/pgBackRestTest/Env/Host/HostDbTest.pm @@ -467,13 +467,7 @@ sub clusterStop # Disconnect user session $self->sqlDisconnect(); - # If postmaster process is running then stop the cluster - if (-e $self->dbBasePath() . '/' . DB_FILE_POSTMASTERPID) - { - $self->executeSimple($self->pgBinPath() . '/pg_ctl stop -D ' . $self->dbBasePath() . ' -w -s -m fast'); - } - - # Grep for errors in postgresql.log + # Grep for errors in postgresql.log - this is done first because we want to ignore any errors that happen during shutdown if (!$bIgnoreLogError && storageTest()->exists($self->pgLogFile())) { $self->executeSimple( @@ -481,6 +475,12 @@ sub clusterStop {iExpectedExitStatus => 1}); } + # If postmaster process is running then stop the cluster + if (-e $self->dbBasePath() . '/' . DB_FILE_POSTMASTERPID) + { + $self->executeSimple($self->pgBinPath() . '/pg_ctl stop -D ' . $self->dbBasePath() . ' -w -s -m fast'); + } + # Remove the log file storageTest()->remove($self->pgLogFile(), {bIgnoreMissing => true}); }