[postgis-tickets] [PostGIS] #5365: interrupt tests fail due to change in error message

PostGIS trac at osgeo.org
Thu Apr 27 14:36:21 PDT 2023


#5365: interrupt tests fail due to change in error message
------------------------+---------------------------
  Reporter:  strk       |      Owner:  robe
      Type:  defect     |     Status:  new
  Priority:  medium     |  Milestone:  PostGIS 3.4.0
 Component:  buildbots  |    Version:  master
Resolution:             |   Keywords:
------------------------+---------------------------
Comment (by strk):

 The statement timeout error comes from PostgreSQL itself:

 > src/backend/tcop/postgres.c:3368:
 errmsg("canceling statement due to statement timeout")));


 I think the error changed with commit
 [17708aa3c2cd5079b2b26f1befad43ec30036aa6/git] when a {{{ ! strstr }}} was
 changed to a {{{ strstr }}} conditional in this block:


 {{{


 /* Return NULL on GEOS error
  *
  * Prints error message only if it was not for interruption, in which
  * case we let PostgreSQL deal with the error.
  */
 #define HANDLE_GEOS_ERROR(label) \
   { \
     if (strstr(lwgeom_geos_errmsg, "InterruptedException")) \
       ereport(ERROR, \
         (errcode(ERRCODE_QUERY_CANCELED), errmsg("canceling statement due
 to user request"))); \
     else \
       lwpgerror("%s: %s", (label), lwgeom_geos_errmsg); \
     PG_RETURN_NULL(); \
   }

 }}}

 The commit referenced #4070

 Honestly I don't know if we can distinguish "user request" from "timeout",
 but I suspect the PostgreSQL error code would know it. For sure the
 testcase uses a timeout, which may not be the same thing as a "user
 request" (^C).

 In any case, that commit changed the error message without updating the
 tests, which ended up under the carpet when CI failed to consistently
 succeed with them (due to real-time clock not being predictable with CI).
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5365#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list