[
https://issues.apache.org/jira/browse/OAK-9447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17886723#comment-17886723
]
Raffaele Gambelli commented on OAK-9447:
----------------------------------------
Sorry [~corderob] I noticed that at least the VersionGCSupportTest class of
oak-document-store, should it find a docker env, using testcontainers starts an
instance of mongodb to run tests on it.
That test does a mongodb query which is simply wrong and it always was wrong
even if earlier versions:
{code:java}
final Bson sort = and(eq(MODIFIED_IN_SECS, 1), eq(ID, 1));
// we need to add query condition to ignore `previous` documents which doesn't
have this field
final Bson query = exists(MODIFIED_IN_SECS);
FindIterable<BasicDBObject> limit =
getNodeCollection().find(query).sort(sort).limit(1);
{code}
in the $sort you can't insert $and, but that test starts if and only if it find
a docker up and running....so I ask if tests which are run in jenkins make use
of docker...i believe not because that test in my opinion is really wrong due
to that way to do query.
Here it is the syntax of
[$sort|https://www.mongodb.com/docs/manual/reference/operator/aggregation/sort]
maybe that test for some reason never runs on jenkins, do you know anything
about that? That test doesn't work, here it is errors:
[ERROR] Failures:
[ERROR] VersionGCSupportTest.findModifiedDocsWhenModifiedIsDifferent:288
expected:<40> but was:<0>
[ERROR] VersionGCSupportTest.findModifiedDocsWhenOldestDocIsPresent:323
expected:<40> but was:<0>
[ERROR] VersionGCSupportTest.findOldestModified:265 diff (s) should be < 5:
1234567
[ERROR] Errors:
[ERROR] VersionGCSupportTest.findModifiedDocsWhenOldestDocIsAbsent:376 ┬╗
MongoQuery Co...
[ERROR] VersionGCSupportTest.getPossiblyModifiedDocs:166->assertModified:398
┬╗ MongoQuery
and here the mongo exception:
{noformat}
[ERROR] getPossiblyModifiedDocs[MongoFixture:
MongoDB](org.apache.jackrabbit.oak.plugins.document.VersionGCSupportTest) Time
elapsed: 0.208 s <<< ERROR!
com.mongodb.MongoQueryException: Command failed with error 15974
(Location15974): 'Illegal key in $sort specification: $and: [ { _modified: 1 },
{ _id: 1 } ]' on server localhost:62097. The full response is {"ok": 0.0,
"errmsg": "Illegal key in $sort specification: $and: [ { _modified: 1 }, { _id:
1 } ]", "code": 15974, "codeName": "Location15974"}
{noformat}
> Upgrade Mongo java driver to 4.7
> --------------------------------
>
> Key: OAK-9447
> URL: https://issues.apache.org/jira/browse/OAK-9447
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: documentmk
> Reporter: José Andrés Cordero Benítez
> Assignee: Jose Andrés Cordero
> Priority: Major
>
> Upgrade Mongo java driver to 4.2+
--
This message was sent by Atlassian Jira
(v8.20.10#820010)