jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Reschke (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-5930) incorrect test assumption in CacheConsistencyTestBase wrt batching
Date Wed, 15 Mar 2017 12:51:41 GMT

    [ https://issues.apache.org/jira/browse/OAK-5930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15926091#comment-15926091
] 

Julian Reschke commented on OAK-5930:
-------------------------------------

Making the operation "best effort" makes the test pass:

{noformat}
--- src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java  (revision
1787037)
+++ src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java  (working
copy)
@@ -319,10 +319,20 @@
     @Override
     public <T extends Document> List<T> createOrUpdate(Collection<T> collection,
List<UpdateOp> updateOps) {
         if (!BATCHUPDATES) {
+            RuntimeException keepex = null;
             List<T> results = new ArrayList<T>(updateOps.size());
             for (UpdateOp update : updateOps) {
-                results.add(createOrUpdate(collection, update));
+                try {
+                    results.add(createOrUpdate(collection, update));
+                }
+                catch (RuntimeException ex) {
+                    keepex = ex;
+                }
             }
+            if (keepex != null) {
+                throw keepex;
+            }
+
             return results;
         }
{noformat}

However I'm not too happy to bend the behavior just to satisfy the test...

> incorrect test assumption in CacheConsistencyTestBase wrt batching
> ------------------------------------------------------------------
>
>                 Key: OAK-5930
>                 URL: https://issues.apache.org/jira/browse/OAK-5930
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: documentmk
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Minor
>             Fix For: 1.8
>
>
> When testing
> {noformat}
> ds.createOrUpdate(Collection.NODES, Lists.newArrayList(up1, up2, up3));
> {noformat}
> the test case assumes that all three IDs ought to be updated. However, this is not true
if the DocumentStore doesn't support batching here (RDB in OAK <= 1.2), or if batching
is disabled ({{org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.BATCHUPDATES}}
system property).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message