Skip to content

Commit

Permalink
build: fix the java test target dependencies (#128)
Browse files Browse the repository at this point in the history
The `test` target in the Java Makefile has an incorrect dependency graph
that could cause tests to start executing before the compilation finished
(or even started) when make is invoked in job server mode.

Fix it by specifying target dependencies such that running the tests depends
on having the tests compiled first.
  • Loading branch information
isaac-io committed Oct 19, 2022
1 parent d2fa7aa commit dfa7fb4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions java/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,12 @@ java_test: java resolve_test_deps
$(AM_V_at) $(JAVAC_CMD) $(JAVAC_ARGS) -cp $(MAIN_CLASSES):$(JAVA_TESTCLASSPATH) -h $(NATIVE_INCLUDE) -d $(TEST_CLASSES)\
$(TEST_SOURCES)

test: java java_test
$(MAKE) run_test
test: run_test

run_test:
run_test: java_test
$(JAVA_CMD) $(JAVA_ARGS) -Djava.library.path=target -cp "$(MAIN_CLASSES):$(TEST_CLASSES):$(JAVA_TESTCLASSPATH):target/*" org.rocksdb.test.RocksJunitRunner $(ALL_JAVA_TESTS)

run_plugin_test:
run_plugin_test: java_test
$(JAVA_CMD) $(JAVA_ARGS) -Djava.library.path=target -cp "$(MAIN_CLASSES):$(TEST_CLASSES):$(JAVA_TESTCLASSPATH):target/*" org.rocksdb.test.RocksJunitRunner $(ROCKSDB_PLUGIN_JAVA_TESTS)

db_bench: java
Expand Down

0 comments on commit dfa7fb4

Please sign in to comment.