From cbee6a7abd4187e1e675bf5521f5c8275c70f223 Mon Sep 17 00:00:00 2001 From: laodouya Date: Thu, 16 May 2019 12:11:06 +0800 Subject: [PATCH 1/3] Add eventual mode in stable test. --- test/stable/run_aws.sh | 11 ++++++++++- test/stable/scripts/start.sh | 27 ++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/test/stable/run_aws.sh b/test/stable/run_aws.sh index 0427415b7..de4254316 100755 --- a/test/stable/run_aws.sh +++ b/test/stable/run_aws.sh @@ -30,5 +30,14 @@ if [[ -z "$1" ]]; then ./scripts/start.sh miner3 ./scripts/start.sh client else - ./scripts/start.sh $1 + if [[ "$1" == "eventual" ]]; then + ./scripts/start.sh bp + ./scripts/start.sh miner0 + ./scripts/start.sh miner1 + ./scripts/start.sh miner2 + ./scripts/start.sh miner3 + ./scripts/start.sh client_eventual + else + ./scripts/start.sh $1 + fi fi diff --git a/test/stable/scripts/start.sh b/test/stable/scripts/start.sh index 46c1629e7..27b351c82 100755 --- a/test/stable/scripts/start.sh +++ b/test/stable/scripts/start.sh @@ -15,6 +15,13 @@ fi cd ${WORKING_DIR} +build_client(){ + cd ${RUNNING_DIR} + go build -o 500million + docker cp covenantsql_bp_1:/app/cql ${RUNNING_DIR} + sleep 3s +} + case $role in bp) # start bp @@ -46,16 +53,26 @@ case $role in docker-compose start covenantsql_miner_3 ;; client) - cd ${RUNNING_DIR} - docker cp covenantsql_bp_1:/app/cql ${RUNNING_DIR} - sleep 3s + build_client + ${RUNNING_DIR}/cql create -config ${RUNNING_DIR}/node_c/config.yaml \ -wait-tx-confirm -db-node 4 -advance-payment 2000000000 dsn=$(cat ${RUNNING_DIR}/node_c/.dsn | tail -n1) #Start client - go build -o 500million - nohup ${RUNNING_DIR}/500million -config ${RUNNING_DIR}/node_c/config.yaml -dsn ${dsn} > ${LOG_DIR}/client.log 2>&1 & + nohup ${RUNNING_DIR}/500million -config ${RUNNING_DIR}/node_c/config.yaml \ + -dsn ${dsn} > ${LOG_DIR}/client.log 2>&1 & + ;; + client_eventual) + build_client + + ${RUNNING_DIR}/cql create -config ${RUNNING_DIR}/node_c/config.yaml \ + -wait-tx-confirm -db-node 4 -advance-payment 2000000000 -db-eventual-consistency + dsn_eventual=$(cat ${RUNNING_DIR}/node_c/.dsn | tail -n1) + + #Start eventual client + nohup ${RUNNING_DIR}/500million -config ${RUNNING_DIR}/node_c/config.yaml \ + -dsn ${dsn_eventual} > ${LOG_DIR}/client_eventual.log 2>&1 & ;; esac From 19ac1fff323a210dc2227de000fd89d9309e31eb Mon Sep 17 00:00:00 2001 From: laodouya Date: Thu, 16 May 2019 12:23:34 +0800 Subject: [PATCH 2/3] Fix stable test cql create params outdate. --- test/stable/scripts/start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/stable/scripts/start.sh b/test/stable/scripts/start.sh index 27b351c82..a3f38f162 100755 --- a/test/stable/scripts/start.sh +++ b/test/stable/scripts/start.sh @@ -56,7 +56,7 @@ case $role in build_client ${RUNNING_DIR}/cql create -config ${RUNNING_DIR}/node_c/config.yaml \ - -wait-tx-confirm -db-node 4 -advance-payment 2000000000 + -wait-tx-confirm -db-node 4 -db-advance-payment 2000000000 dsn=$(cat ${RUNNING_DIR}/node_c/.dsn | tail -n1) #Start client @@ -67,7 +67,7 @@ case $role in build_client ${RUNNING_DIR}/cql create -config ${RUNNING_DIR}/node_c/config.yaml \ - -wait-tx-confirm -db-node 4 -advance-payment 2000000000 -db-eventual-consistency + -wait-tx-confirm -db-node 4 -db-advance-payment 2000000000 -db-eventual-consistency dsn_eventual=$(cat ${RUNNING_DIR}/node_c/.dsn | tail -n1) #Start eventual client From eea168f4c3d9addde6e709bbdcb2cea737030653 Mon Sep 17 00:00:00 2001 From: laodouya Date: Thu, 16 May 2019 12:41:41 +0800 Subject: [PATCH 3/3] Increase stable test thread pool concurrency count and size. --- test/stable/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/stable/main.go b/test/stable/main.go index 36d4cfd2d..474062ced 100644 --- a/test/stable/main.go +++ b/test/stable/main.go @@ -67,7 +67,7 @@ func insertData(db *sql.DB, tableName string, dataCount int64, pool *grpool.Pool atomic.StoreInt32(&errCount, 0) } } - if i%1000 == 0 { + if i%10000 == 0 { log.Infof("%v Inserted: %v %v\n", time.Now().Sub(start), tableName, i) } if errCount > 10000 { @@ -109,7 +109,7 @@ func main() { createSqliteTestTable(db, tableName) - pool := grpool.NewPool(16, 32) + pool := grpool.NewPool(64, 512) defer pool.Release() insertData(db, tableName, 500000000, pool) pool.WaitAll()