From 9be383a3a688f0450034a96449a2609a394f0292 Mon Sep 17 00:00:00 2001 From: Peter Kester Date: Fri, 11 Aug 2023 17:23:19 +0200 Subject: [PATCH] #169 added parameter for debug wait timeout. Can be set in gradle properties by specifying a value for mlDebugWaitTimeout --- .../src/main/ml-modules/root/test/test-coverage.xqy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/marklogic-unit-test-modules/src/main/ml-modules/root/test/test-coverage.xqy b/marklogic-unit-test-modules/src/main/ml-modules/root/test/test-coverage.xqy index ebe2e0f..5a424d0 100644 --- a/marklogic-unit-test-modules/src/main/ml-modules/root/test/test-coverage.xqy +++ b/marklogic-unit-test-modules/src/main/ml-modules/root/test/test-coverage.xqy @@ -33,6 +33,8 @@ declare option xdmp:mapping "false"; (: Half a million lines of XQuery ought to be enough for any module. :) declare variable $LIMIT as xs:integer := 654321 ; +declare variable $TIMEOUT := "%%mlDebugWaitTimeout%%"; +declare variable $DEFAULT_TIMEOUT := 10; declare private function cover:_put( $map as map:map, @@ -71,8 +73,8 @@ declare private function cover:_task-cancel-safe( for $breakpoint in dbg:breakpoints($id) return dbg:clear($id, $breakpoint), dbg:detach($id), - if (fn:empty(dbg:wait($id, 10))) then - fn:error(xs:QName("FAILED-TO-CANCEL"), "unable to cancel a debugging request") + if (fn:empty(dbg:wait($id, if ($TIMEOUT eq "%%mlDebugWaitTimeout%%") then $DEFAULT_TIMEOUT else $TIMEOUT))) + then fn:error(xs:QName("FAILED-TO-CANCEL"), "unable to cancel a debugging request") else () } catch ($ex) {