Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1a9d802

Browse files
committed
Fix some issues with TAP tests for postgres -C
This addresses two issues with the tests added in0c39c29 for runtimeGUCs:- Re-enable the test on Msys. The test could fail because of \r\ngenerated by Msys perl.0d91c52 has taken care of this issue.- Allow the test to run in the context of a privileged account. CIsrunning under privileged accounts would fail on permission failures, asreported by Andres Freund. This issue is fixed by wrapping the postgrescommand within pg_ctl as the latter will take care of any permissionsneeded. The test checking a failure of postgres -C for a runtimeparameter with an instance running is removed, as pg_ctl produces anunstable error code (no need for a CI to reproduce that).Discussion:https://postgr.es/m/20210921032040.lyl4lcax37aedx2x@alap3.anarazel.de
1 parent0d91c52 commit1a9d802

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

‎src/bin/pg_checksums/t/002_actions.pl

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use TestLib;
1212

1313
use Fcntlqw(:seek);
14-
use Test::Moretests=>69;
14+
use Test::Moretests=>66;
1515

1616

1717
# Utility routine to create and check a table with corrupted checksums
@@ -181,34 +181,25 @@ sub check_relation_corruption
181181

182182
# Test postgres -C for an offline cluster.
183183
# Run-time GUCs are safe to query here. Note that a lock file is created,
184-
# thenunlinked, leading to an extra LOG entry showing in stderr.
185-
SKIP:
186-
{
187-
skip"unstable output generated with Msys", 3
188-
if ($Config{osname}eq'msys');
189-
command_checks_all(
190-
['postgres','-D',$pgdata,'-C','data_checksums' ],
191-
0,
192-
[qr/^on$/],
193-
# LOG entry when unlinking lock file.
194-
[qr/database system is shut down/],
195-
'data_checksums=on is reported on an offline cluster');
196-
}
184+
# thenremoved, leading to an extra LOG entry showing in stderr. This uses
185+
# log_min_messages=fatal to remove any noise. This test uses a startup
186+
# wrapped with pg_ctl to allow the case where this runs under a privileged
187+
# account on Windows.
188+
command_checks_all(
189+
[
190+
'pg_ctl','start','-D',$pgdata,'-s','-o',
191+
'-C data_checksums -c log_min_messages=fatal'
192+
],
193+
1,
194+
[qr/^on$/],
195+
[qr/could not start server/],
196+
'data_checksums=on is reported on an offline cluster');
197197

198198
# Checks cannot happen with an online cluster
199199
$node->start;
200200
command_fails(['pg_checksums','--check','-D',$pgdata ],
201201
"fails with online cluster");
202202

203-
# Test postgres -C on an online cluster.
204-
command_fails_like(
205-
['postgres','-D',$pgdata,'-C','data_checksums' ],
206-
qr/lock file .* already exists/,
207-
'data_checksums is not reported on an online cluster');
208-
command_ok(
209-
['postgres','-D',$pgdata,'-C','work_mem' ],
210-
'non-runtime parameter is reported on an online cluster');
211-
212203
# Check corruption of table on default tablespace.
213204
check_relation_corruption($node,'corrupt1','pg_default');
214205

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp