From 710aa109059b910be1ff5b7bc859a57dfc639b85 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 12 Dec 2021 09:16:51 +0100 Subject: [PATCH 1/2] [ticket/16939] Wait for postgresql service to start on windows CI runners PHPBB3-16939 --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ab81a550b0..8d06a82c7d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -554,8 +554,11 @@ jobs: run: | $postgreSqlSvc = Get-Service "postgresql*" Set-Service $postgreSqlSvc.Name -StartupType manual + $runningStatus = [System.ServiceProcess.ServiceControllerStatus]::Running + $maxStartTimeout = New-TimeSpan -Seconds 30 try { $postgreSqlSvc.Start() + $postgreSqlSvc.WaitForStatus($runningStatus, $maxStartTimeout) } catch { $_ | select * } From 6801f7949f970b0e96127e680e539dd0a862ee90 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 12 Dec 2021 09:39:14 +0100 Subject: [PATCH 2/2] [ticket/16939] Use ALTER SYSTEM queries to modify psql config variables PHPBB3-16939 --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8d06a82c7d..e0481236fc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -564,8 +564,8 @@ jobs: } [System.Environment]::SetEnvironmentVariable('PATH',$Env:PATH+";${env:PGBIN}") $env:PGPASSWORD = 'root' - psql -c hot_standby=on - psql -c wal_level=minimal + psql -c 'ALTER SYSTEM SET hot_standby = on;' -U postgres + psql -c 'ALTER SYSTEM SET wal_level = minimal;' -U postgres psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres psql -c 'create database phpbb_tests;' -U postgres Set-MpPreference -ExclusionPath "${env:PGDATA}" # Exclude PGDATA directory from Windows Defender