[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-758-gbb57343f1

git at osgeo.org git at osgeo.org
Fri May 5 06:18:42 PDT 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  bb57343f1a316d3d838cacb26c92b495365d3751 (commit)
       via  b6f5c74b6ea6a2fc9ac095ca0993434b9efc945c (commit)
      from  b0d9783f417b3116d5624cc060979decacd978ba (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bb57343f1a316d3d838cacb26c92b495365d3751
Author: Sandro Santilli <strk at kbt.io>
Date:   Fri May 5 15:18:08 2023 +0200

    Run ST_Buffer once before moving on with the interrupt test
    
    This is an attempt to ensure the library is loaded before
    taking the starting time.

diff --git a/regress/core/interrupt_buffer.sql b/regress/core/interrupt_buffer.sql
index effde1ca6..54c958e04 100644
--- a/regress/core/interrupt_buffer.sql
+++ b/regress/core/interrupt_buffer.sql
@@ -10,14 +10,6 @@ BEGIN
 	-- posssible time
   lap := now()-t FROM _time;
 
-  UPDATE _time SET t = clock_timestamp();
-
-	-- Increase tolerated value based on some machine-dependent
-	-- timing. This code uses the time it took to update a temporary
-	-- table but we could use something more meaningful, maybe
-	-- finding it in a GUC or something set by a pre-hook
-	tolerated = tolerated + (clock_timestamp()-now());
-
   IF lap <= tolerated THEN
 		ret := format(
 			'%s interrupted on time',
@@ -30,6 +22,8 @@ BEGIN
 		);
   END IF;
 
+  UPDATE _time SET t = clock_timestamp();
+
   RETURN ret;
 END;
 $$ LANGUAGE 'plpgsql' VOLATILE;
@@ -44,9 +38,9 @@ SELECT 1::int as id, ST_Collect(g) g FROM (
  ) foo
 ;
 
--- Run ST_Buffer once to ensure libary is loaded before
--- taking the time
---SELECT NULL FROM ST_NPoints(ST_Buffer('POINT(0 0)'::geometry, 3, 1));
+-- Run ST_Buffer once to ensure the libary is loaded
+-- before taking the start time
+SELECT NULL FROM ST_Buffer('POINT(0 0)'::geometry, 3, 1);
 
 CREATE TEMPORARY TABLE _time AS SELECT now() t;
 

commit b6f5c74b6ea6a2fc9ac095ca0993434b9efc945c
Author: Sandro Santilli <strk at kbt.io>
Date:   Fri May 5 15:13:05 2023 +0200

    Report tolerated values in all interrupt tests

diff --git a/regress/core/interrupt.sql b/regress/core/interrupt.sql
index 57e1ddea4..209847ef5 100644
--- a/regress/core/interrupt.sql
+++ b/regress/core/interrupt.sql
@@ -1,22 +1,37 @@
 -- liblwgeom interruption
 
-CREATE TEMPORARY TABLE _time AS SELECT now() t;
-
 CREATE FUNCTION _timecheck(label text, tolerated interval) RETURNS text
 AS $$
 DECLARE
   ret TEXT;
   lap INTERVAL;
 BEGIN
+	-- We use now() here to get the time at the
+	-- start of the transaction, which started when
+	-- this function was called, so the earliest
+	-- posssible time
   lap := now()-t FROM _time;
-  IF lap <= tolerated THEN ret := label || ' interrupted on time';
-  ELSE ret := label || ' interrupted late: ' || lap;
+
+  IF lap <= tolerated THEN
+		ret := format(
+			'%s interrupted on time',
+			label
+		);
+  ELSE
+		ret := format(
+			'%s interrupted late: %s (%s tolerated)',
+			label, lap, tolerated
+		);
   END IF;
-  UPDATE _time SET t = now();
+
+  UPDATE _time SET t = clock_timestamp();
+
   RETURN ret;
 END;
 $$ LANGUAGE 'plpgsql' VOLATILE;
 
+CREATE TEMPORARY TABLE _time AS SELECT now() t;
+
 -----------------
 -- ST_Segmentize
 -----------------
diff --git a/regress/core/interrupt_buffer.sql b/regress/core/interrupt_buffer.sql
index 1a1f6682b..effde1ca6 100644
--- a/regress/core/interrupt_buffer.sql
+++ b/regress/core/interrupt_buffer.sql
@@ -44,8 +44,11 @@ SELECT 1::int as id, ST_Collect(g) g FROM (
  ) foo
 ;
 
-CREATE TEMPORARY TABLE _time AS SELECT now() t;
+-- Run ST_Buffer once to ensure libary is loaded before
+-- taking the time
+--SELECT NULL FROM ST_NPoints(ST_Buffer('POINT(0 0)'::geometry, 3, 1));
 
+CREATE TEMPORARY TABLE _time AS SELECT now() t;
 
 -----------------
 -- ST_Buffer
diff --git a/regress/core/interrupt_relate.sql b/regress/core/interrupt_relate.sql
index 466baa867..22f06afbc 100644
--- a/regress/core/interrupt_relate.sql
+++ b/regress/core/interrupt_relate.sql
@@ -1,7 +1,5 @@
 set client_min_messages to WARNING;
 
-CREATE TEMPORARY TABLE _time AS SELECT now() t;
-
 CREATE FUNCTION _timecheck(label text, tolerated interval) RETURNS text
 AS $$
 DECLARE
@@ -9,10 +7,21 @@ DECLARE
   lap INTERVAL;
 BEGIN
   lap := now()-t FROM _time;
-  IF lap <= tolerated THEN ret := label || ' interrupted on time';
-  ELSE ret := label || ' interrupted late: ' || lap;
+
+  IF lap <= tolerated THEN
+		ret := format(
+			'%s interrupted on time',
+			label
+		);
+  ELSE
+		ret := format(
+			'%s interrupted late: %s (%s tolerated)',
+			label, lap, tolerated
+		);
   END IF;
-  UPDATE _time SET t = now();
+
+  UPDATE _time SET t = clock_timestamp();
+
   RETURN ret;
 END;
 $$ LANGUAGE 'plpgsql' VOLATILE;
@@ -27,7 +36,7 @@ SELECT 1::int as id, ST_Collect(g) g FROM (
  ) foo
 ;
 
-UPDATE _time SET t = now(); -- reset time as creating tables spends some
+CREATE TEMPORARY TABLE _time AS SELECT now() t;
 
 -----------------------------
 -- IM9 based predicates

-----------------------------------------------------------------------

Summary of changes:
 regress/core/interrupt.sql        | 25 ++++++++++++++++++++-----
 regress/core/interrupt_buffer.sql | 15 ++++++---------
 regress/core/interrupt_relate.sql | 21 +++++++++++++++------
 3 files changed, 41 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list