TestOs ignores a locally built sqllogictest library when the checkout path contains a target directory
Describe the bug
TestOs decides whether to load a locally built sqllogictest library
(core/rust/qdb-sqllogictest/target/{release,debug}/libqdbsqllogictest.*) or the precompiled library
from core/target/test-classes/io/questdb/bin/<os>-<arch>/. To find the sources root, it takes the
precompiled library's path and cuts it at the first /target/:
int targetIndex = absolutePathPreCompiled.indexOf("/target/");(core/src/test/java/io/questdb/test/TestOs.java:95)
When the checkout lives under a directory named target, for example /home/u/target/questdb, the first
match is that outer directory, and the sources root resolves to /home/u. The dev library paths then point
at /home/u/rust/qdb-sqllogictest/target/..., which does not exist. Their timestamps read as 0, and
TestOs silently loads the precompiled library, ignoring the developer's fresh local build.
Tests still run, but against a stale sqllogictest library, with no message saying so.
To reproduce
- Check out the repo under a path that contains a
targetdirectory, e.g./tmp/target/questdb. - Build
core/rust/qdb-sqllogictestlocally so its library is newer than the precompiled one. - Run any
AbstractCairoTestsubclass: stderr never showsLoading DEV release sqllogictest library.
Expected
TestOs cuts at the target directory of the core module: lastIndexOf("/target/").
QuestDB version
master
Found while working on #7674.
Source: questdb/questdb