diff --git a/Makefile b/Makefile index 0251ae10453..ef22f69ff76 100644 --- a/Makefile +++ b/Makefile @@ -66,4 +66,4 @@ clean_tidb: clean: cargo clean - @rm -rf $(DEPS_PATH) $(BIN_PATH) \ No newline at end of file + @rm -rf $(DEPS_PATH) $(BIN_PATH) diff --git a/tests/raftstore/cluster.rs b/tests/raftstore/cluster.rs index d3a76d45142..c942a079769 100644 --- a/tests/raftstore/cluster.rs +++ b/tests/raftstore/cluster.rs @@ -173,7 +173,7 @@ impl Cluster { let region_id = request.get_header().get_region_id(); loop { let leader = match self.leader_of_region(region_id) { - None => return Err(box_err!("can't get leader of region")), + None => return Err(box_err!("can't get leader of region {}", region_id)), Some(l) => l, }; request.mut_header().set_peer(leader); diff --git a/tests/raftstore/util.rs b/tests/raftstore/util.rs index 298ca780e71..9089b33f50c 100644 --- a/tests/raftstore/util.rs +++ b/tests/raftstore/util.rs @@ -68,7 +68,7 @@ pub fn new_store_cfg() -> Config { Config { raft_base_tick_interval: 10, raft_heartbeat_ticks: 2, - raft_election_timeout_ticks: 20, + raft_election_timeout_ticks: 25, raft_log_gc_tick_interval: 100, raft_log_gc_threshold: 1, pd_heartbeat_tick_interval: 20, diff --git a/travis-build/Makefile b/travis-build/Makefile index c34c30ad3f5..9a657e26918 100644 --- a/travis-build/Makefile +++ b/travis-build/Makefile @@ -71,6 +71,7 @@ cover_linux: export LIBRARY_PATH="${LIBRARY_PATH}:${ROCKSDB_DIR}" && \ export LOG_LEVEL=DEBUG && \ export RUST_BACKTRACE=1 && \ + export RUST_TEST_THREADS=1 && \ grep " Running " tests.out | sed -e 's/Running//g' | xargs -n 1 -i ${KCOV_DIR}/kcov --verify --coveralls-id=${TRAVIS_JOB_ID} --include-pattern tikv/src --exclude-pattern tikv/src/bin --strip-path `pwd`/ target/kcov {} --nocapture cover_osx: diff --git a/travis-build/test.sh b/travis-build/test.sh index b5e290554a3..d4ab8869433 100755 --- a/travis-build/test.sh +++ b/travis-build/test.sh @@ -26,6 +26,7 @@ fi export ENABLE_FEATURES=default export LOG_FILE=tests.log +export RUST_TEST_THREADS=1 make test 2>&1 | tee tests.out status=$? for case in `cat tests.out | python -c "import sys @@ -41,10 +42,12 @@ print '\n'.join(cases) "`; do echo find fail cases: $case grep $case $LOG_FILE | cut -d ' ' -f 2- + # there is a thread panic, which should not happen. + status=1 echo done -rm tests.out || true +# don't remove the tests.out, coverage counts on it. rm $LOG_FILE || true exit $status