You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by ma...@apache.org on 2024/12/27 03:07:51 UTC

(cloudberry) branch main updated: Fix flake test bfv_meta_track (#817)

This is an automated email from the ASF dual-hosted git repository.

maxyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/main by this push:
     new 679a1e26ac Fix flake test bfv_meta_track (#817)
679a1e26ac is described below

commit 679a1e26ac75e6c839af144db2f7a0fb1ea1c558
Author: Jianghua.yjh <yj...@gmail.com>
AuthorDate: Fri Dec 27 11:07:46 2024 +0800

    Fix flake test bfv_meta_track (#817)
    
    One suppose is that oid_wraparound test is before bfv_meta_track test.
    Add stasubtype limit , make test stable.
---
 src/test/regress/expected/bfv_meta_track.out | 75 +++++++++++++++-------------
 src/test/regress/sql/bfv_meta_track.sql      | 33 ++++++------
 2 files changed, 56 insertions(+), 52 deletions(-)

diff --git a/src/test/regress/expected/bfv_meta_track.out b/src/test/regress/expected/bfv_meta_track.out
index 8a68d45d1b..fe1d94b73b 100644
--- a/src/test/regress/expected/bfv_meta_track.out
+++ b/src/test/regress/expected/bfv_meta_track.out
@@ -7,12 +7,12 @@ drop schema if exists bfv_meta_track;
 -- end_ignore
 create schema bfv_meta_track;
 set search_path to bfv_meta_track;
-select staactionname, stasubtype, nspname from pg_stat_last_operation join
-  pg_namespace on pg_namespace.oid = pg_stat_last_operation.objid
-  where pg_namespace.nspname = 'bfv_meta_track';
- staactionname | stasubtype |    nspname     
----------------+------------+----------------
- CREATE        | SCHEMA     | bfv_meta_track
+select count(*) from pg_stat_last_operation p join
+  pg_namespace on pg_namespace.oid = p.objid
+  where pg_namespace.nspname = 'bfv_meta_track' and p.stasubtype = 'SCHEMA';
+ count 
+-------
+     1
 (1 row)
 
 -- test drop popicy
@@ -20,45 +20,48 @@ create table t1(a int);
 NOTICE:  Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table.
 HINT:  The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
 create policy p1 on t1 using (a % 2 = 0);
-select staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid;
- staactionname | stasubtype 
----------------+------------
- CREATE        | POLICY
+select count(*) from pg_stat_last_operation a join pg_policy b on b.oid = a.objid
+where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid and a.stasubtype = 'POLICY';
+ count 
+-------
+     1
 (1 row)
 
--- start_ignore
-select a.xmin as pg_stat_last_operation_xmin, a.xmax as pg_stat_last_operation_xmax,
-  b.xmin as pg_policy_xmin, b.xmax as pg_policy_xmax,
-  staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid
-  where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid;
-
-select xmin, xmax, relname from pg_class where oid in (select objid from (select objid, staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid ) a) ;
-
--- end_ignore
-select relname from pg_class where oid in (select objid from (select objid, staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid ) a) ;
- relname 
----------
-(0 rows)
-
 drop policy p1 on t1;
-select staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid;
- staactionname | stasubtype 
----------------+------------
-(0 rows)
+select count(*) from pg_stat_last_operation a join pg_policy b on b.oid = a.objid
+where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid and a.stasubtype = 'POLICY';
+ count 
+-------
+     0
+(1 row)
 
 --test drop publication
 -- start_ignore
 create publication pub1;
 -- end_ignore
-select staactionname, stasubtype from pg_stat_last_operation a join pg_publication b on b.oid = a.objid where b.pubname = 'pub1';
- staactionname | stasubtype  
----------------+-------------
- CREATE        | PUBLICATION
+select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid
+where b.pubname = 'pub1' and a.stasubtype = 'PUBLICATION';
+ count 
+-------
+     1
 (1 row)
 
 drop publication pub1;
-select staactionname, stasubtype from pg_stat_last_operation a join pg_publication b on b.oid = a.objid where b.pubname = 'pub1';
- staactionname | stasubtype 
----------------+------------
-(0 rows)
+select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid
+where b.pubname = 'pub1' and a.stasubtype = 'PUBLICATION';
+ count 
+-------
+     0
+(1 row)
+
+drop schema bfv_meta_track cascade;
+NOTICE:  drop cascades to table t1
+-- test drop schema
+select count(*) from pg_stat_last_operation join
+  pg_namespace on pg_namespace.oid = pg_stat_last_operation.objid
+  where pg_namespace.nspname = 'bfv_meta_track';
+ count 
+-------
+     0
+(1 row)
 
diff --git a/src/test/regress/sql/bfv_meta_track.sql b/src/test/regress/sql/bfv_meta_track.sql
index 89a51428aa..3966e56041 100644
--- a/src/test/regress/sql/bfv_meta_track.sql
+++ b/src/test/regress/sql/bfv_meta_track.sql
@@ -8,30 +8,31 @@ drop schema if exists bfv_meta_track;
 -- end_ignore
 create schema bfv_meta_track;
 set search_path to bfv_meta_track;
-select staactionname, stasubtype, nspname from pg_stat_last_operation join
-  pg_namespace on pg_namespace.oid = pg_stat_last_operation.objid
-  where pg_namespace.nspname = 'bfv_meta_track';
+select count(*) from pg_stat_last_operation p join
+  pg_namespace on pg_namespace.oid = p.objid
+  where pg_namespace.nspname = 'bfv_meta_track' and p.stasubtype = 'SCHEMA';
 
 -- test drop popicy
 create table t1(a int);
 create policy p1 on t1 using (a % 2 = 0);
-select staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid;
--- start_ignore
-select a.xmin as pg_stat_last_operation_xmin, a.xmax as pg_stat_last_operation_xmax,
-  b.xmin as pg_policy_xmin, b.xmax as pg_policy_xmax,
-  staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid
-  where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid;
-select xmin, xmax, relname from pg_class where oid in (select objid from (select objid, staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid ) a) ;
--- end_ignore
-select relname from pg_class where oid in (select objid from (select objid, staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid ) a) ;
-
+select count(*) from pg_stat_last_operation a join pg_policy b on b.oid = a.objid
+where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid and a.stasubtype = 'POLICY';
 drop policy p1 on t1;
-select staactionname, stasubtype from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid;
+select count(*) from pg_stat_last_operation a join pg_policy b on b.oid = a.objid
+where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid and a.stasubtype = 'POLICY';
 
 --test drop publication
 -- start_ignore
 create publication pub1;
 -- end_ignore
-select staactionname, stasubtype from pg_stat_last_operation a join pg_publication b on b.oid = a.objid where b.pubname = 'pub1';
+select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid
+where b.pubname = 'pub1' and a.stasubtype = 'PUBLICATION';
 drop publication pub1;
-select staactionname, stasubtype from pg_stat_last_operation a join pg_publication b on b.oid = a.objid where b.pubname = 'pub1';
\ No newline at end of file
+select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid
+where b.pubname = 'pub1' and a.stasubtype = 'PUBLICATION';
+
+drop schema bfv_meta_track cascade;
+-- test drop schema
+select count(*) from pg_stat_last_operation join
+  pg_namespace on pg_namespace.oid = pg_stat_last_operation.objid
+  where pg_namespace.nspname = 'bfv_meta_track';


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org