Skip to content

Commit 01a7acd

Browse files
authored
FIx regress and TAP test for amcheck and enable in CI (#1489)
Fix amcheck regression test output Turns out amcheck contrib expression test were read since DIRECTORY TABLE feature. Fix that, also add amcheck to CI Also, fix TAP test. 003 - disable this test, 2PC tx are not supported for CBDB. for 001 - replace verify_heapam with verify_heapam_internal, for sake of this test expected output.
1 parent c9ca88d commit 01a7acd

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

.github/workflows/build-cloudberry.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ jobs:
286286
},
287287
{"test":"ic-contrib",
288288
"make_configs":["contrib/auto_explain:installcheck",
289+
"contrib/amcheck:installcheck",
289290
"contrib/citext:installcheck",
290291
"contrib/btree_gin:installcheck",
291292
"contrib/file_fdw:installcheck",

.github/workflows/build-deb-cloudberry.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ jobs:
225225
},
226226
{"test":"ic-deb-contrib",
227227
"make_configs":["contrib/auto_explain:installcheck",
228+
"contrib/amcheck:installcheck",
228229
"contrib/citext:installcheck",
229230
"contrib/btree_gin:installcheck",
230231
"contrib/file_fdw:installcheck",

contrib/amcheck/expected/check_heap.out

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ CREATE TABLE test_partitioned (a int, b text default repeat('x', 5000))
227227
SELECT * FROM verify_heapam('test_partitioned',
228228
startblock := NULL,
229229
endblock := NULL);
230-
ERROR: "test_partitioned" is not a table, materialized view, or TOAST table
230+
ERROR: "test_partitioned" is not a table, directory table, materialized view, or TOAST table
231231
CONTEXT: SQL statement "SELECT t.blkno, t.offnum, t.attnum, t.msg
232232
FROM verify_heapam_internal(relation,
233233
on_error_stop,
@@ -268,7 +268,7 @@ CREATE INDEX test_index ON test_partition (a);
268268
SELECT * FROM verify_heapam('test_index',
269269
startblock := NULL,
270270
endblock := NULL);
271-
ERROR: "test_index" is not a table, materialized view, or TOAST table
271+
ERROR: "test_index" is not a table, directory table, materialized view, or TOAST table
272272
CONTEXT: SQL statement "SELECT t.blkno, t.offnum, t.attnum, t.msg
273273
FROM verify_heapam_internal(relation,
274274
on_error_stop,
@@ -283,7 +283,7 @@ CREATE VIEW test_view AS SELECT 1;
283283
SELECT * FROM verify_heapam('test_view',
284284
startblock := NULL,
285285
endblock := NULL);
286-
ERROR: "test_view" is not a table, materialized view, or TOAST table
286+
ERROR: "test_view" is not a table, directory table, materialized view, or TOAST table
287287
CONTEXT: SQL statement "SELECT t.blkno, t.offnum, t.attnum, t.msg
288288
FROM verify_heapam_internal(relation,
289289
on_error_stop,
@@ -298,7 +298,7 @@ CREATE SEQUENCE test_sequence;
298298
SELECT * FROM verify_heapam('test_sequence',
299299
startblock := NULL,
300300
endblock := NULL);
301-
ERROR: "test_sequence" is not a table, materialized view, or TOAST table
301+
ERROR: "test_sequence" is not a table, directory table, materialized view, or TOAST table
302302
CONTEXT: SQL statement "SELECT t.blkno, t.offnum, t.attnum, t.msg
303303
FROM verify_heapam_internal(relation,
304304
on_error_stop,
@@ -315,7 +315,7 @@ CREATE FOREIGN TABLE test_foreign_table () SERVER dummy_server;
315315
SELECT * FROM verify_heapam('test_foreign_table',
316316
startblock := NULL,
317317
endblock := NULL);
318-
ERROR: "test_foreign_table" is not a table, materialized view, or TOAST table
318+
ERROR: "test_foreign_table" is not a table, directory table, materialized view, or TOAST table
319319
CONTEXT: SQL statement "SELECT t.blkno, t.offnum, t.attnum, t.msg
320320
FROM verify_heapam_internal(relation,
321321
on_error_stop,

contrib/amcheck/t/001_verify_heapam.pl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,32 @@
3131
#
3232
fresh_test_table('test');
3333
corrupt_first_page('test');
34-
detects_heap_corruption("verify_heapam('test')", "plain corrupted table");
34+
detects_heap_corruption("verify_heapam_internal('test')", "plain corrupted table");
3535
detects_heap_corruption(
36-
"verify_heapam('test', skip := 'all-visible')",
36+
"verify_heapam_internal('test', skip := 'all-visible')",
3737
"plain corrupted table skipping all-visible");
3838
detects_heap_corruption(
39-
"verify_heapam('test', skip := 'all-frozen')",
39+
"verify_heapam_internal('test', skip := 'all-frozen')",
4040
"plain corrupted table skipping all-frozen");
4141
detects_heap_corruption(
42-
"verify_heapam('test', check_toast := false)",
42+
"verify_heapam_internal('test', check_toast := false)",
4343
"plain corrupted table skipping toast");
4444
detects_heap_corruption(
45-
"verify_heapam('test', startblock := 0, endblock := 0)",
45+
"verify_heapam_internal('test', startblock := 0, endblock := 0)",
4646
"plain corrupted table checking only block zero");
4747

4848
#
4949
# Check a corrupt table with all-frozen data
5050
#
5151
fresh_test_table('test');
5252
$node->safe_psql('postgres', q(VACUUM (FREEZE, DISABLE_PAGE_SKIPPING) test));
53-
detects_no_corruption("verify_heapam('test')",
53+
detects_no_corruption("verify_heapam_internal('test')",
5454
"all-frozen not corrupted table");
5555
corrupt_first_page('test');
56-
detects_heap_corruption("verify_heapam('test')",
56+
detects_heap_corruption("verify_heapam_internal('test')",
5757
"all-frozen corrupted table");
5858
detects_no_corruption(
59-
"verify_heapam('test', skip := 'all-frozen')",
59+
"verify_heapam_internal('test', skip := 'all-frozen')",
6060
"all-frozen corrupted table skipping all-frozen");
6161

6262
# Returns the filesystem path for the named relation.
@@ -208,7 +208,7 @@ sub check_all_options_uncorrupted
208208
. "endblock := $endblock";
209209

210210
detects_no_corruption(
211-
"verify_heapam('$relname', $opts)",
211+
"verify_heapam_internal('$relname', $opts)",
212212
"$prefix: $opts");
213213
}
214214
}

contrib/amcheck/t/003_cic_2pc.pl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
use PostgresNode;
1010
use TestLib;
1111

12-
use Test::More tests => 5;
12+
use Test::More tests => 0 + 1;#5;
13+
14+
SKIP:
15+
{
16+
skip "TWO PHASE transactions are not supported in Cloudberry, skip test", 1;
1317

1418
Test::More->builder->todo_start('filesystem bug')
1519
if TestLib::has_wal_read_bug;
@@ -186,3 +190,4 @@
186190

187191
$node->stop;
188192
done_testing();
193+
}

0 commit comments

Comments
 (0)