Skip to content

Commit 2418927

Browse files
committed
pg_amcheck: Try to fix still more test failures.
Avoid use of non-portable option ordering in command_checks_all(). The use of bare command line arguments before switches doesn't work everywhere. Per buildfarm members drongo and hoverfly. Avoid testing for the message "role \"%s\" does not exist", because some buildfarm machines report a different error. fairywren complains about "SSPI authentication failed for user \"%s\"", for example. Mark Dilger Discussion: http://postgr.es/m/9E76E46A-48B2-4869-BD0C-422204C1F767@enterprisedb.com Discussion: http://postgr.es/m/F0A1FD70-A2F4-4528-8A03-8650CAEC0554%40enterprisedb.com
1 parent f371a4c commit 2418927

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/bin/pg_amcheck/t/002_nonesuch.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use PostgresNode;
55
use TestLib;
6-
use Test::More tests => 76;
6+
use Test::More tests => 75;
77

88
# Test set-up
99
my ($node, $port);
@@ -68,7 +68,7 @@
6868
[ 'pg_amcheck', '-U', 'no_such_user', 'postgres' ],
6969
1,
7070
[ qr/^$/ ],
71-
[ qr/role "no_such_user" does not exist/ ],
71+
[ ],
7272
'checking with a non-existent user');
7373

7474
# Failing to connect to the initial database due to bad username is an still an

src/bin/pg_amcheck/t/003_check.pl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ ()
375375
# are quiet.
376376
#
377377
$node->command_checks_all(
378-
[ @cmd, 'db1', '-t', 's1.*', '--no-dependent-indexes' ],
378+
[ @cmd, '-t', 's1.*', '--no-dependent-indexes', 'db1' ],
379379
0,
380380
[ $no_output_re ],
381381
[ $no_output_re ],
@@ -384,7 +384,7 @@ ()
384384
# Checking db2.s1 should show table corruptions if indexes are excluded
385385
#
386386
$node->command_checks_all(
387-
[ @cmd, 'db2', '-t', 's1.*', '--no-dependent-indexes' ],
387+
[ @cmd, '-t', 's1.*', '--no-dependent-indexes', 'db2' ],
388388
2,
389389
[ $missing_file_re ],
390390
[ $no_output_re ],
@@ -394,7 +394,7 @@ ()
394394
# corruption messages on stdout, and nothing on stderr.
395395
#
396396
$node->command_checks_all(
397-
[ @cmd, 'db1', '-s', 's3' ],
397+
[ @cmd, '-s', 's3', 'db1' ],
398398
2,
399399
[ $index_missing_relation_fork_re,
400400
$line_pointer_corruption_re,
@@ -407,22 +407,22 @@ ()
407407
# options the toast corruption is reported, but when excluding toast we get no
408408
# error reports.
409409
$node->command_checks_all(
410-
[ @cmd, 'db1', '-s', 's4' ],
410+
[ @cmd, '-s', 's4', 'db1' ],
411411
2,
412412
[ $missing_file_re ],
413413
[ $no_output_re ],
414414
'pg_amcheck in schema s4 reports toast corruption');
415415

416416
$node->command_checks_all(
417-
[ @cmd, '--no-dependent-toast', '--exclude-toast-pointers', 'db1', '-s', 's4' ],
417+
[ @cmd, '--no-dependent-toast', '--exclude-toast-pointers', '-s', 's4', 'db1' ],
418418
0,
419419
[ $no_output_re ],
420420
[ $no_output_re ],
421421
'pg_amcheck in schema s4 excluding toast reports no corruption');
422422

423423
# Check that no corruption is reported in schema db1.s5
424424
$node->command_checks_all(
425-
[ @cmd, 'db1', '-s', 's5' ],
425+
[ @cmd, '-s', 's5', 'db1' ],
426426
0,
427427
[ $no_output_re ],
428428
[ $no_output_re ],
@@ -432,7 +432,7 @@ ()
432432
# the indexes, no corruption is reported about the schema.
433433
#
434434
$node->command_checks_all(
435-
[ @cmd, 'db1', '-s', 's1', '-I', 't1_btree', '-I', 't2_btree' ],
435+
[ @cmd, '-s', 's1', '-I', 't1_btree', '-I', 't2_btree', 'db1' ],
436436
0,
437437
[ $no_output_re ],
438438
[ $no_output_re ],
@@ -443,7 +443,7 @@ ()
443443
# about the schema.
444444
#
445445
$node->command_checks_all(
446-
[ @cmd, 'db1', '-t', 's1.*', '--no-dependent-indexes' ],
446+
[ @cmd, '-t', 's1.*', '--no-dependent-indexes', 'db1' ],
447447
0,
448448
[ $no_output_re ],
449449
[ $no_output_re ],
@@ -453,7 +453,7 @@ ()
453453
# tables that no corruption is reported.
454454
#
455455
$node->command_checks_all(
456-
[ @cmd, 'db1', '-s', 's2', '-T', 't1', '-T', 't2' ],
456+
[ @cmd, '-s', 's2', '-T', 't1', '-T', 't2', 'db1' ],
457457
0,
458458
[ $no_output_re ],
459459
[ $no_output_re ],
@@ -463,7 +463,7 @@ ()
463463
# to avoid getting messages about corrupt tables or indexes.
464464
#
465465
command_fails_like(
466-
[ @cmd, 'db1', '-s', 's5', '--startblock', 'junk' ],
466+
[ @cmd, '-s', 's5', '--startblock', 'junk', 'db1' ],
467467
qr/invalid start block/,
468468
'pg_amcheck rejects garbage startblock');
469469

@@ -473,7 +473,7 @@ ()
473473
'pg_amcheck rejects garbage endblock');
474474

475475
command_fails_like(
476-
[ @cmd, 'db1', '-s', 's5', '--startblock', '5', '--endblock', '4' ],
476+
[ @cmd, '-s', 's5', '--startblock', '5', '--endblock', '4', 'db1' ],
477477
qr/end block precedes start block/,
478478
'pg_amcheck rejects invalid block range');
479479

@@ -482,14 +482,14 @@ ()
482482
# arguments are handled sensibly.
483483
#
484484
$node->command_checks_all(
485-
[ @cmd, 'db1', '-s', 's1', '-i', 't1_btree', '--parent-check' ],
485+
[ @cmd, '-s', 's1', '-i', 't1_btree', '--parent-check', 'db1' ],
486486
2,
487487
[ $index_missing_relation_fork_re ],
488488
[ $no_output_re ],
489489
'pg_amcheck smoke test --parent-check');
490490

491491
$node->command_checks_all(
492-
[ @cmd, 'db1', '-s', 's1', '-i', 't1_btree', '--heapallindexed', '--rootdescend' ],
492+
[ @cmd, '-s', 's1', '-i', 't1_btree', '--heapallindexed', '--rootdescend', 'db1' ],
493493
2,
494494
[ $index_missing_relation_fork_re ],
495495
[ $no_output_re ],

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy