[
https://issues.apache.org/jira/browse/OAK-12440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rishabh Daim updated OAK-12440:
-------------------------------
Description:
Parallel QueryTest fixtures share the JVM-wide oak.useOldInexistenceCheck
property. The legacy test sets it to true; another fixture can query or restore
it concurrently, causing incorrect compatibility semantics and sometimes
leaving true behind.
Confirmed on clean trunk f80bf24b86 with Java 17 and all Oak dependencies built
from that checkout. Running the two existing tests through their normal
parallel runner on Segment Tar and MongoDB, ten repetitions produced 12
failures in 40 executions, including the exact CI error: missing
/test/one/child and /test/two/child. No delays or property overrides were
injected. The ordinary full-class runs passed, confirming the failure depends
on timing.
The race dates to
[77c326d485|https://github.com/apache/jackrabbit-oak/commit/77c326d4856a069b34c97c9a579abbd9510308ca]
(OAK-6838, 2017) and does not require the Caffeine changes.
Serialize both compatibility tests, explicitly select their behavior and
restore the incoming property. Keep all assertions and production code
unchanged. With the fix and the same trunk dependencies, all 40 focused
executions pass; the full class passes 72 cases with two existing skips. Thirty
controlled overlaps also pass and restore unset/true/false values.
[Failing CI
build|https://github.com/apache/jackrabbit-oak/actions/runs/37548375160/job/112557758876]
| [Fix PR #3194|https://github.com/apache/jackrabbit-oak/pull/3194]
was:
QueryTest runs repository fixtures in parallel. Its legacy relative-property
test sets the JVM-wide oak.useOldInexistenceCheck property to true while the
newer test assumes false. A concurrent query can therefore use the wrong
semantics and miss /test/one/child and /test/two/child.
The race was introduced by
[77c326d485|https://github.com/apache/jackrabbit-oak/commit/77c326d4856a069b34c97c9a579abbd9510308ca]
under OAK-6838 in 2017. It is independent of the Caffeine changes. Setting the
property to true reproduces the exact assertion failure in isolation.
Serialize the two compatibility tests across fixtures, explicitly select each
test's behavior and restore the incoming property. Keep every query assertion
and leave production code unchanged. Validate both tests and the full QueryTest
class with parallel Segment Tar and Document fixtures.
[Failing build on PR
#3185|https://github.com/apache/jackrabbit-oak/actions/runs/37548375160/job/112557758876]
Validation (Java 17): all 72 QueryTest cases pass with Segment Tar and MongoDB
(two existing skips). A controlled overlap reproduces the exact failure before
the fix; 30 overlaps pass afterwards and restore unset/true/false property
values.
> Isolate relative property query tests across parallel fixtures
> --------------------------------------------------------------
>
> Key: OAK-12440
> URL: https://issues.apache.org/jira/browse/OAK-12440
> Project: Jackrabbit Oak
> Issue Type: Test
> Reporter: Rishabh Daim
> Assignee: Rishabh Daim
> Priority: Minor
>
> Parallel QueryTest fixtures share the JVM-wide oak.useOldInexistenceCheck
> property. The legacy test sets it to true; another fixture can query or
> restore it concurrently, causing incorrect compatibility semantics and
> sometimes leaving true behind.
> Confirmed on clean trunk f80bf24b86 with Java 17 and all Oak dependencies
> built from that checkout. Running the two existing tests through their normal
> parallel runner on Segment Tar and MongoDB, ten repetitions produced 12
> failures in 40 executions, including the exact CI error: missing
> /test/one/child and /test/two/child. No delays or property overrides were
> injected. The ordinary full-class runs passed, confirming the failure depends
> on timing.
> The race dates to
> [77c326d485|https://github.com/apache/jackrabbit-oak/commit/77c326d4856a069b34c97c9a579abbd9510308ca]
> (OAK-6838, 2017) and does not require the Caffeine changes.
> Serialize both compatibility tests, explicitly select their behavior and
> restore the incoming property. Keep all assertions and production code
> unchanged. With the fix and the same trunk dependencies, all 40 focused
> executions pass; the full class passes 72 cases with two existing skips.
> Thirty controlled overlaps also pass and restore unset/true/false values.
> [Failing CI
> build|https://github.com/apache/jackrabbit-oak/actions/runs/37548375160/job/112557758876]
> | [Fix PR #3194|https://github.com/apache/jackrabbit-oak/pull/3194]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)