]> granicus.if.org Git - postgis/commitdiff
Add timing check to interrupt tests
authorSandro Santilli <strk@keybit.net>
Thu, 6 Nov 2014 17:22:20 +0000 (17:22 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 6 Nov 2014 17:22:20 +0000 (17:22 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13120 b70326c6-7e19-0410-871a-916f4a2858ee

regress/interrupt.sql
regress/interrupt_expected

index 16af1e144436c6da2bc344547bd60b7bf4c4c78e..dfb87299a1425631fe862889a786059c74f88853 100644 (file)
@@ -1,13 +1,21 @@
+CREATE TEMPORARY TABLE _time AS SELECT now() t;
+
 SET statement_timeout TO 100;
 
 select ST_Buffer(g,100) from (
   select (st_dumppoints(st_buffer(st_makepoint(0,0),10000,100000))).geom g
 ) foo;
 
+SELECT 'buffer_interrupted_on_time', now()-t < '150ms'::interval
+FROM _time; UPDATE _time SET t = now();
+
 SELECT
 ST_Segmentize(ST_MakeLine(ST_MakePoint(4,39), ST_MakePoint(1,41)),
   1e-100);
 
+SELECT 'segmentize_interrupted_on_time', now()-t < '150ms'::interval
+FROM _time; UPDATE _time SET t = now();
+
 SET statement_timeout TO 0;
 
 -- Not affected by timeout
index d9fa03e21fbb3bd814c0d65b3b335fd79ef2720e..2e479ab94e01be529e8c5ca82cec5c10c4283851 100644 (file)
@@ -1,4 +1,6 @@
 ERROR:  canceling statement due to statement timeout
+buffer_interrupted_on_time|t
 NOTICE:  liblwgeom code interrupted
 ERROR:  canceling statement due to statement timeout
+segmentize_interrupted_on_time|t
 1|LINESTRING(0 0,2 0,4 0)