From: Toine Siebelink Date: Thu, 27 Jul 2023 15:14:19 +0000 (+0000) Subject: Merge "Improve 32K limit tests" X-Git-Tag: 3.3.6~33 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=16e9ea97a6a46f3e59cf600a528953c9c0e8e48c;hp=a2b046b1d7c4814646e93e7d9cf28a4a66e27ec3;p=cps.git Merge "Improve 32K limit tests" --- diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimitsPerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimitsPerfTest.groovy index e0df2fee7..9cb65ab8f 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimitsPerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataServiceLimitsPerfTest.groovy @@ -23,9 +23,9 @@ package org.onap.cps.integration.performance.cps import java.time.OffsetDateTime import org.onap.cps.api.CpsDataService import org.onap.cps.integration.performance.base.CpsPerfTestBase -import org.onap.cps.spi.exceptions.DataNodeNotFoundException -import static org.onap.cps.spi.FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS +import static org.onap.cps.spi.FetchDescendantsOption.DIRECT_CHILDREN_ONLY +import static org.onap.cps.spi.FetchDescendantsOption.OMIT_DESCENDANTS class CpsDataServiceLimitsPerfTest extends CpsPerfTestBase { @@ -33,31 +33,67 @@ class CpsDataServiceLimitsPerfTest extends CpsPerfTestBase { def setup() { objectUnderTest = cpsDataService } - 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..