- def 'Multiple get limit exceeded: 32,764 (~ 2^15) xpaths.'() {
- given: 'more than 32,764 xpaths'
- def xpaths = (0..40_000).collect { "/size/of/this/path/does/not/matter/for/limit[@id='" + it + "']" }
- when: 'single operation is executed to get all datanodes with given xpaths'
- objectUnderTest.getDataNodesForMultipleXpaths(CPS_PERFORMANCE_TEST_DATASPACE, 'bookstore1', xpaths, INCLUDE_ALL_DESCENDANTS)
- then: 'a database exception is not thrown'
- noExceptionThrown()
+ def 'Create 33,000 books (note further tests depend on this running first).'() {
+ given: 'an anchor containing a bookstore with one category'
+ cpsAdminService.createAnchor(CPS_PERFORMANCE_TEST_DATASPACE, BOOKSTORE_SCHEMA_SET, 'limitsAnchor')
+ def parentNodeData = '{"bookstore": { "categories": [{ "code": 1, "name": "Test", "books" : [] }] }}'
+ cpsDataService.saveData(CPS_PERFORMANCE_TEST_DATASPACE, 'limitsAnchor', parentNodeData, OffsetDateTime.now())
+ when: '33,000 books are added'
+ stopWatch.start()
+ for (int i = 1; i <= 33_000; i+=100) {
+ def booksData = '{"books":[' + (i..<i+100).collect {'{ "title": "' + it + '" }' }.join(',') + ']}'
+ cpsDataService.saveData(CPS_PERFORMANCE_TEST_DATASPACE, 'limitsAnchor', '/bookstore/categories[@code=1]', booksData, OffsetDateTime.now())
+ }
+ stopWatch.stop()
+ def durationInMillis = stopWatch.getTotalTimeMillis()
+ then: 'the operation completes within 10 seconds'
+ recordAndAssertPerformance("Creating 33,000 books", 10_000, durationInMillis)
+ }
+
+ def 'Get data nodes from multiple xpaths 32K (2^15) limit exceeded.'() {
+ given: '33,000 xpaths'
+ def xpaths = (1..33_000).collect { "/bookstore/categories[@code=1]/books[@title='${it}']".toString() }
+ when: 'a single operation is executed to get all datanodes with given xpaths'
+ def results = objectUnderTest.getDataNodesForMultipleXpaths(CPS_PERFORMANCE_TEST_DATASPACE, 'limitsAnchor', xpaths, OMIT_DESCENDANTS)
+ then: '33,000 data nodes are returned'
+ assert results.size() == 33_000