Skip to content

Commit 27703c3

Browse files
committed
roachtest/pg_regress: adjust the runner a bit
Now that we addressed one of the issues, we can remove part of the diff we apply to `type_sanity.sql`. Also we're now seeing some errors on `privileges.sql` file during post test assertions, so we temporarily skip them - this will be investigated separately. Release note: None
1 parent eda5474 commit 27703c3

File tree

2 files changed

+29
-57
lines changed

2 files changed

+29
-57
lines changed

pkg/cmd/roachtest/testdata/pg_regress/type_sanity.diffs

Lines changed: 25 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -437,25 +437,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
437437
-- Look for range types that do not have a pg_range entry
438438
SELECT t1.oid, t1.typname
439439
FROM pg_type as t1
440-
@@ -113,10 +479,13 @@
441-
-- Text conversion routines must be provided.
442-
SELECT t1.oid, t1.typname
443-
FROM pg_type as t1
444-
-WHERE (t1.typinput = 0 OR t1.typoutput = 0);
445-
- oid | typname
446-
------+---------
447-
-(0 rows)
448-
+WHERE (t1.typinput = 0 OR t1.typoutput = 0)
449-
+ORDER BY t1.oid;
450-
+ oid | typname
451-
+------+---------
452-
+ 2276 | any
453-
+ 2279 | trigger
454-
+(2 rows)
455-
456-
-- Check for bogus typinput routines
457-
SELECT t1.oid, t1.typname, p1.oid, p1.proname
458-
@@ -128,10 +497,7 @@
440+
@@ -128,10 +494,7 @@
459441
(p1.pronargs = 3 AND p1.proargtypes[0] = 'cstring'::regtype AND
460442
p1.proargtypes[1] = 'oid'::regtype AND
461443
p1.proargtypes[2] = 'int4'::regtype));
@@ -467,7 +449,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
467449
-- As of 8.0, this check finds refcursor, which is borrowing
468450
-- other types' I/O routines
469451
SELECT t1.oid, t1.typname, p1.oid, p1.proname
470-
@@ -140,10 +506,9 @@
452+
@@ -140,10 +503,9 @@
471453
(t1.typelem != 0 AND t1.typlen < 0) AND NOT
472454
(p1.prorettype = t1.oid AND NOT p1.proretset)
473455
ORDER BY 1;
@@ -481,7 +463,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
481463

482464
-- Varlena array types will point to array_in
483465
-- Exception as of 8.1: int2vector and oidvector have their own I/O routines
484-
@@ -153,10 +518,10 @@
466+
@@ -153,10 +515,10 @@
485467
(t1.typelem != 0 AND t1.typlen < 0) AND NOT
486468
(p1.oid = 'array_in'::regproc)
487469
ORDER BY 1;
@@ -496,7 +478,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
496478
(2 rows)
497479

498480
-- typinput routines should not be volatile
499-
@@ -172,14 +537,11 @@
481+
@@ -172,14 +534,11 @@
500482
FROM pg_type AS t1
501483
WHERE t1.typtype not in ('b', 'p')
502484
ORDER BY 1;
@@ -514,7 +496,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
514496

515497
-- Check for bogus typoutput routines
516498
-- As of 8.0, this check finds refcursor, which is borrowing
517-
@@ -192,19 +554,15 @@
499+
@@ -192,19 +551,15 @@
518500
(p1.oid = 'array_out'::regproc AND
519501
t1.typelem != 0 AND t1.typlen = -1)))
520502
ORDER BY 1;
@@ -538,7 +520,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
538520
-- typoutput routines should not be volatile
539521
SELECT t1.oid, t1.typname, p1.oid, p1.proname
540522
FROM pg_type AS t1, pg_proc AS p1
541-
@@ -218,13 +576,11 @@
523+
@@ -218,13 +573,11 @@
542524
FROM pg_type AS t1
543525
WHERE t1.typtype not in ('b', 'd', 'p')
544526
ORDER BY 1;
@@ -555,7 +537,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
555537

556538
-- Domains should have same typoutput as their base types
557539
SELECT t1.oid, t1.typname, t2.oid, t2.typname
558-
@@ -244,10 +600,7 @@
540+
@@ -244,10 +597,7 @@
559541
(p1.pronargs = 3 AND p1.proargtypes[0] = 'internal'::regtype AND
560542
p1.proargtypes[1] = 'oid'::regtype AND
561543
p1.proargtypes[2] = 'int4'::regtype));
@@ -567,7 +549,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
567549
-- As of 7.4, this check finds refcursor, which is borrowing
568550
-- other types' I/O routines
569551
SELECT t1.oid, t1.typname, p1.oid, p1.proname
570-
@@ -256,10 +609,9 @@
552+
@@ -256,10 +606,9 @@
571553
(t1.typelem != 0 AND t1.typlen < 0) AND NOT
572554
(p1.prorettype = t1.oid AND NOT p1.proretset)
573555
ORDER BY 1;
@@ -581,7 +563,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
581563

582564
-- Varlena array types will point to array_recv
583565
-- Exception as of 8.1: int2vector and oidvector have their own I/O routines
584-
@@ -271,8 +623,8 @@
566+
@@ -271,8 +620,8 @@
585567
ORDER BY 1;
586568
oid | typname | oid | proname
587569
-----+------------+------+----------------
@@ -592,7 +574,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
592574
(2 rows)
593575

594576
-- Suspicious if typreceive doesn't take same number of args as typinput
595-
@@ -297,14 +649,11 @@
577+
@@ -297,14 +646,11 @@
596578
FROM pg_type AS t1
597579
WHERE t1.typtype not in ('b', 'p')
598580
ORDER BY 1;
@@ -610,7 +592,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
610592

611593
-- Check for bogus typsend routines
612594
-- As of 7.4, this check finds refcursor, which is borrowing
613-
@@ -317,10 +666,9 @@
595+
@@ -317,10 +663,9 @@
614596
(p1.oid = 'array_send'::regproc AND
615597
t1.typelem != 0 AND t1.typlen = -1)))
616598
ORDER BY 1;
@@ -624,7 +606,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
624606

625607
SELECT t1.oid, t1.typname, p1.oid, p1.proname
626608
FROM pg_type AS t1, pg_proc AS p1
627-
@@ -343,13 +691,11 @@
609+
@@ -343,13 +688,11 @@
628610
FROM pg_type AS t1
629611
WHERE t1.typtype not in ('b', 'd', 'p')
630612
ORDER BY 1;
@@ -641,7 +623,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
641623

642624
-- Domains should have same typsend as their base types
643625
SELECT t1.oid, t1.typname, t2.oid, t2.typname
644-
@@ -366,10 +712,7 @@
626+
@@ -366,10 +709,7 @@
645627
(p1.pronargs = 1 AND
646628
p1.proargtypes[0] = 'cstring[]'::regtype AND
647629
p1.prorettype = 'int4'::regtype AND NOT p1.proretset);
@@ -653,7 +635,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
653635
-- typmodin routines should not be volatile
654636
SELECT t1.oid, t1.typname, p1.oid, p1.proname
655637
FROM pg_type AS t1, pg_proc AS p1
656-
@@ -385,10 +728,7 @@
638+
@@ -385,10 +725,7 @@
657639
(p1.pronargs = 1 AND
658640
p1.proargtypes[0] = 'int4'::regtype AND
659641
p1.prorettype = 'cstring'::regtype AND NOT p1.proretset);
@@ -665,7 +647,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
665647
-- typmodout routines should not be volatile
666648
SELECT t1.oid, t1.typname, p1.oid, p1.proname
667649
FROM pg_type AS t1, pg_proc AS p1
668-
@@ -409,7 +749,8 @@
650+
@@ -409,7 +746,8 @@
669651
-- Array types should have same typdelim as their element types
670652
SELECT t1.oid, t1.typname, t2.oid, t2.typname
671653
FROM pg_type AS t1, pg_type AS t2
@@ -675,7 +657,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
675657
oid | typname | oid | typname
676658
-----+---------+-----+---------
677659
(0 rows)
678-
@@ -428,29 +769,20 @@
660+
@@ -428,29 +766,20 @@
679661
SELECT t1.oid, t1.typname, t1.typelem
680662
FROM pg_type AS t1
681663
WHERE t1.typelem != 0 AND t1.typsubscript = 0;
@@ -708,7 +690,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
708690
-- Check for bogus typanalyze routines
709691
SELECT t1.oid, t1.typname, p1.oid, p1.proname
710692
FROM pg_type AS t1, pg_proc AS p1
711-
@@ -458,10 +790,7 @@
693+
@@ -458,10 +787,7 @@
712694
(p1.pronargs = 1 AND
713695
p1.proargtypes[0] = 'internal'::regtype AND
714696
p1.prorettype = 'bool'::regtype AND NOT p1.proretset);
@@ -720,7 +702,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
720702
-- there does not seem to be a reason to care about volatility of typanalyze
721703
-- domains inherit their base type's typanalyze
722704
SELECT d.oid, d.typname, d.typanalyze, t.oid, t.typname, t.typanalyze
723-
@@ -477,10 +806,7 @@
705+
@@ -477,10 +803,7 @@
724706
FROM pg_type t LEFT JOIN pg_range r on t.oid = r.rngtypid
725707
WHERE t.typbasetype = 0 AND
726708
(t.typanalyze = 'range_typanalyze'::regproc) != (r.rngtypid IS NOT NULL);
@@ -732,7 +714,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
732714
-- array_typanalyze should be used for all and only array types
733715
-- (but exclude domains, which we checked above)
734716
-- As of 9.2 this finds int2vector and oidvector, which are weird anyway
735-
@@ -490,12 +816,7 @@
717+
@@ -490,12 +813,7 @@
736718
(t.typanalyze = 'array_typanalyze'::regproc) !=
737719
(t.typsubscript = 'array_subscript_handler'::regproc)
738720
ORDER BY 1;
@@ -746,7 +728,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
746728
-- **************** pg_class ****************
747729
-- Look for illegal values in pg_class fields
748730
SELECT c1.oid, c1.relname
749-
@@ -535,14 +856,10 @@
731+
@@ -535,14 +853,10 @@
750732
(0 rows)
751733

752734
-- Tables, matviews etc should have AMs of type 't'
@@ -765,7 +747,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
765747
-- **************** pg_attribute ****************
766748
-- Look for illegal values in pg_attribute fields
767749
SELECT a1.attrelid, a1.attname
768-
@@ -555,22 +872,46 @@
750+
@@ -555,22 +869,46 @@
769751
(0 rows)
770752

771753
-- Cross-check attnum against parent relation
@@ -822,7 +804,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
822804

823805
-- Cross-check against pg_type entry
824806
-- NOTE: we allow attstorage to be 'plain' even when typstorage is not;
825-
@@ -613,10 +954,7 @@
807+
@@ -613,10 +951,7 @@
826808
EXISTS(select 1 from pg_catalog.pg_type where
827809
oid = r.rngsubtype and typelem != 0 and
828810
typsubscript = 'array_subscript_handler'::regproc)));
@@ -834,7 +816,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
834816
-- canonical function, if any, had better match the range type
835817
SELECT r.rngtypid, r.rngsubtype, p.proname
836818
FROM pg_range r JOIN pg_proc p ON p.oid = r.rngcanonical
837-
@@ -639,10 +977,7 @@
819+
@@ -639,10 +974,7 @@
838820
SELECT r.rngtypid, r.rngsubtype, r.rngmultitypid
839821
FROM pg_range r
840822
WHERE r.rngmultitypid IS NULL OR r.rngmultitypid = 0;
@@ -846,7 +828,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
846828
-- Create a table that holds all the known in-core data types and leave it
847829
-- around so as pg_upgrade is able to test their binary compatibility.
848830
CREATE TABLE tab_core_types AS SELECT
849-
@@ -709,6 +1044,13 @@
831+
@@ -709,6 +1041,13 @@
850832
'{(2020-01-02 03:04:05, 2021-02-03 06:07:08)}'::tsmultirange,
851833
'(2020-01-02 03:04:05, 2021-02-03 06:07:08)'::tstzrange,
852834
'{(2020-01-02 03:04:05, 2021-02-03 06:07:08)}'::tstzmultirange;
@@ -860,7 +842,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/type_sanity.out -
860842
-- Sanity check on the previous table, checking that all core types are
861843
-- included in this table.
862844
SELECT oid, typname, typtype, typelem, typarray
863-
@@ -736,7 +1078,4 @@
845+
@@ -736,7 +1075,4 @@
864846
WHERE a.atttypid=t.oid AND
865847
a.attnum > 0 AND
866848
a.attrelid='tab_core_types'::regclass);

pkg/cmd/roachtest/tests/pg_regress.go

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ func runPGRegress(ctx context.Context, t test.Test, c cluster.Cluster) {
418418
t.Fatal(err)
419419
}
420420

421-
t.Status("collecting the test results for test '", testFile, "' (", testIdx, "/", len(tests), ")")
421+
t.Status("collecting the test results for test '", testFile, "' (", testIdx+1, "/", len(tests), ")")
422422
diffFile := testFile + ".diffs"
423423
diffFilePath := filepath.Join(outputDir, diffFile)
424424
tmpFile := diffFile + ".tmp"
@@ -516,6 +516,8 @@ func registerPGRegress(r registry.Registry) {
516516
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
517517
runPGRegress(ctx, t, c)
518518
},
519+
// TODO(#150543): remove this.
520+
SkipPostValidations: registry.PostValidationInvalidDescriptors,
519521
})
520522
}
521523

@@ -859,8 +861,6 @@ index 1b2d434683..d371fe3f63 100644
859861
// pg_catalog.pg_am vtable.
860862
// TODO(#123706): remove the patch to comment out a query against
861863
// pg_catalog.pg_attribute vtable.
862-
// TODO(#146255): remove the patch to include ORDER BY clause for the query
863-
// with "Text conversion routines must be provided." comment in pg_regress.
864864
{"type_sanity.sql", `diff --git a/src/test/regress/sql/type_sanity.sql b/src/test/regress/sql/type_sanity.sql
865865
index 79ec410a6c..417d3dcdb2 100644
866866
--- a/src/test/regress/sql/type_sanity.sql
@@ -885,17 +885,7 @@ index 79ec410a6c..417d3dcdb2 100644
885885
886886
-- Look for "toastable" types that aren'"'"'t varlena.
887887
888-
@@ -91,7 +93,8 @@ WHERE t1.typtype = 'r' AND
889-
890-
SELECT t1.oid, t1.typname
891-
FROM pg_type as t1
892-
-WHERE (t1.typinput = 0 OR t1.typoutput = 0);
893-
+WHERE (t1.typinput = 0 OR t1.typoutput = 0)
894-
+ORDER BY t1.oid;
895-
896-
-- Check for bogus typinput routines
897-
898-
@@ -288,7 +291,8 @@ WHERE t1.typelem = t2.oid AND NOT
888+
@@ -288,7 +290,8 @@ WHERE t1.typelem = t2.oid AND NOT
899889
900890
SELECT t1.oid, t1.typname, t2.oid, t2.typname
901891
FROM pg_type AS t1, pg_type AS t2

0 commit comments

Comments
 (0)