Skip to content

Commit 2aba7d6

Browse files
ryanjdewMarkLogic Builder
authored andcommitted
DHFPROD-8258: Add more test indexing waits
1 parent 3e32513 commit 2aba7d6

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

marklogic-data-hub/src/test/ml-modules/root/test/data-hub-test-helper.xqy

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,12 @@ declare function run-with-roles-and-privileges($roles, $privileges, $func-or-mod
373373

374374
declare function wait-for-indexes()
375375
{
376-
wait-for-indexes(1)
376+
try {
377+
wait-for-indexes(1)
378+
} catch ($e) {
379+
if ($e/error:code = "XDMP-EXTIME") then ()
380+
else xdmp:rethrow()
381+
}
377382
};
378383

379384
declare function wait-for-indexes($count as xs:unsignedLong) {
@@ -382,13 +387,8 @@ declare function wait-for-indexes($count as xs:unsignedLong) {
382387
}, ())
383388
return
384389
if ($is-indexing) then
385-
try {
386-
let $_sleep := xdmp:sleep(5 * $count)
387-
return wait-for-indexes($count + 1)
388-
} catch ($e) {
389-
if ($e/error:code = "XDMP-EXTIME") then ()
390-
else xdmp:rethrow()
391-
}
390+
let $_sleep := xdmp:sleep(5 * $count)
391+
return wait-for-indexes($count + 1)
392392
else
393393
()
394394
};

marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/data-services/job/setup.xqy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ import module namespace hub-test = "http://marklogic.com/data-hub/test" at "/tes
33
import module namespace test = "http://marklogic.com/test" at "/test/test-helper.xqy";
44
hub-test:reset-hub(),
55
hub-test:load-jobs($test:__CALLER_FILE__)
6+
;
7+
xquery version "1.0-ml";
8+
import module namespace hub-test = "http://marklogic.com/data-hub/test" at "/test/data-hub-test-helper.xqy";
9+
hub-test:wait-for-indexes();

marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/smart-mastering/entity-matching/setup.xqy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ xquery version "1.0-ml";
88
import module namespace hub-test = "http://marklogic.com/data-hub/test" at "/test/data-hub-test-helper.xqy";
99
import module namespace test = "http://marklogic.com/test" at "/test/test-helper.xqy";
1010
hub-test:load-artifacts($test:__CALLER_FILE__)
11+
12+
;
13+
14+
xquery version "1.0-ml";
15+
import module namespace hub-test = "http://marklogic.com/data-hub/test" at "/test/data-hub-test-helper.xqy";
16+
hub-test:wait-for-indexes();

marklogic-data-hub/src/test/ml-modules/root/test/suites/data-hub/5/smart-mastering/entity-matching/structured-property/suite-setup.xqy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ hub-test:load-artifacts($test:__CALLER_FILE__)
1414
xquery version "1.0-ml";
1515
import module namespace hub-test = "http://marklogic.com/data-hub/test" at "/test/data-hub-test-helper.xqy";
1616
hub-test:wait-for-indexes()
17+
18+
;
19+
20+
xquery version "1.0-ml";
21+
import module namespace hub-test = "http://marklogic.com/data-hub/test" at "/test/data-hub-test-helper.xqy";
22+
hub-test:wait-for-indexes();

0 commit comments

Comments
 (0)