Skip to content

Commit

Permalink
ci: use full ASAN
Browse files Browse the repository at this point in the history
Previously we used LD_PRELOAD to add ASAN to our build. This is at best
imperfect, since the full benefits of ASAN can only be realized by
adding compiler instrumentation.

This does not run the python, nodejs, or java tests with ASAN. Though
Python can be run with ASAN using LD_PRELOAD, it is super slow, and
would need parallelized testing to be viable (which is not worth it
IMO).

Nodejs and Java just die spectacularly. Overall I think the APIs need
ASAN much less.
  • Loading branch information
Riolku committed Oct 19, 2023
1 parent b70c101 commit 34671ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,10 @@ jobs:
run: npm install --include=dev
working-directory: tools/nodejs_api

- name: Build debug
run: CC=gcc CXX=g++ make alldebug NUM_THREADS=32

- name: Run test with ASan
run: ctest --output-on-failure -j 10
- name: Test with ASAN
run: CC=gcc CXX=g++ make test ASAN=1 NUM_THREADS=32
env:
LD_PRELOAD: "/usr/lib/x86_64-linux-gnu/libasan.so.6"
ASAN_OPTIONS: "detect_leaks=1:log_path=/tmp/asan.log"
working-directory: ./build/debug/test
continue-on-error: true

- name: Report ASan log
run: |
Expand Down
10 changes: 3 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,20 @@ clang-tidy-ci:
$(call mkdirp,build/release) && cd build/release && \
cmake $(GENERATOR) $(FORCE_COLOR) $(SANITIZER_FLAG) -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ../..

pytest:
$(MAKE) release
pytest: release
cd $(ROOT_DIR)/tools/python_api/test && \
python3 -m pytest -v test_main.py

nodejstest:
$(MAKE) nodejs
nodejstest: nodejs
cd $(ROOT_DIR)/tools/nodejs_api/ && \
npm test

javatest: arrow
javatest: arrow java
ifeq ($(OS),Windows_NT)
$(MAKE) java
$(call mkdirp,tools/java_api/build/test) && cd tools/java_api/ && \
javac -d build/test -cp ".;build/kuzu_java.jar;third_party/junit-platform-console-standalone-1.9.3.jar" -sourcepath src/test/java/com/kuzudb/test/*.java && \
java -jar third_party/junit-platform-console-standalone-1.9.3.jar -cp ".;build/kuzu_java.jar;build/test/" --scan-classpath --include-package=com.kuzudb.java_test --details=verbose
else
$(MAKE) java
$(call mkdirp,tools/java_api/build/test) && cd tools/java_api/ && \
javac -d build/test -cp ".:build/kuzu_java.jar:third_party/junit-platform-console-standalone-1.9.3.jar" -sourcepath src/test/java/com/kuzudb/test/*.java && \
java -jar third_party/junit-platform-console-standalone-1.9.3.jar -cp ".:build/kuzu_java.jar:build/test/" --scan-classpath --include-package=com.kuzudb.java_test --details=verbose
Expand Down
3 changes: 1 addition & 2 deletions tools/shell/shell_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ int main(int argc, char* argv[]) {
if (readOnlyMode) {
systemConfig.accessMode = AccessMode::READ_ONLY;
}
std::cout << "Opened the database at path: " << databasePath << std::endl;
std::cout << "Opened the database at path: " << databasePath << " under "
std::cout << "Opened the database at path: " << databasePath << " in "
<< (systemConfig.accessMode == AccessMode::READ_ONLY ? "READ_ONLY mode" :
"READ_WRITE mode")
<< "." << std::endl;
Expand Down

0 comments on commit 34671ef

Please sign in to comment.