This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new 07fbc86a9a OAK-10641: DocumentStore: improve test coverage for large
properties / documents - add test case for revision properties
07fbc86a9a is described below
commit 07fbc86a9a8a241f4542cc9cb79f339a0e899c3a
Author: Julian Reschke <[email protected]>
AuthorDate: Wed Feb 14 12:32:28 2024 +0100
OAK-10641: DocumentStore: improve test coverage for large properties /
documents - add test case for revision properties
---
.../plugins/document/BasicDocumentStoreTest.java | 33 +++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
index 7bb094936e..8a416e2de8 100644
---
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
+++
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
@@ -577,7 +577,7 @@ public class BasicDocumentStoreTest extends
AbstractDocumentStoreTest {
int i = 0;
for (i = 0; i < 32 && exception == null; i++) {
- String pval = generateString(1024 * 1024, true);
+ String pval = generateString(1024 * 1024 + i * 10, true);
String pname = String.format("foo%02d", i);
up.set(pname, pval);
try {
@@ -598,6 +598,37 @@ public class BasicDocumentStoreTest extends
AbstractDocumentStoreTest {
LOG.info("max number of 1MB property additions for " + super.dsname +
" was " + i + " (" + exception + ")");
}
+ @Test
+ public void testMaxAddPropertyUpdate() {
+
+ String id = this.getClass().getName() + ".testMaxAddPropertyUpdate";
+ UpdateOp up = new UpdateOp(id, true);
+ super.ds.create(Collection.NODES, Collections.singletonList(up));
+ String exception = null;
+
+ int i = 0;
+ for (i = 0; i < 32 && exception == null; i++) {
+ String pval = generateString(1024 * 1024 + i * 10, true);
+ String pname = "foo";
+ up.setMapEntry(pname, new Revision(System.currentTimeMillis(), i,
0), pval);
+ try {
+ NodeDocument doc = super.ds.findAndUpdate(Collection.NODES,
up);
+ if (doc != null) {
+ // check that we really can read it
+ NodeDocument findme = super.ds.find(Collection.NODES, id,
0);
+ assertNotNull("failed to retrieve previously stored
document", findme);
+ assertNotNull(findme.get(pname));
+ }
+ } catch (Throwable ex) {
+ LOG.error("trying to add " + i + "th 1MB property " +
super.dsname + ": " + ex.getMessage(), ex);
+ exception = ex.getMessage();
+ }
+ }
+
+ super.ds.remove(Collection.NODES, id);
+ LOG.info("max number of 1MB property updates for " + super.dsname + "
was " + i + " (" + exception + ")");
+ }
+
@Test
public void testInterestingPropLengths() throws
UnsupportedEncodingException {
int lengths[] = { 1, 10, 100, 1000, 2000, 3000, 4000, 5000, 6000,
7000, 8000, 9000, 10000, 11000, 12000, 13000, 14000,