From 754d350b309ae7a04fd09cff06cbf0b9ab060787 Mon Sep 17 00:00:00 2001 From: KuiLiao Date: Tue, 29 Mar 2022 02:03:48 +0800 Subject: [PATCH 1/2] fix helper/bench --- helper/bench/Makefile | 1 + helper/bench/prepare.sh | 4 ++-- helper/bench/svr/http.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/helper/bench/Makefile b/helper/bench/Makefile index e819a4b..72c8094 100644 --- a/helper/bench/Makefile +++ b/helper/bench/Makefile @@ -1,6 +1,7 @@ # All targets. default: bench +# configure these paths according to you system bench: /usr/local/bin/go /etc/redis/redis.conf /usr/local/bin/docker-compose main.go rm -f ../conf.sample.yml go build -o bench diff --git a/helper/bench/prepare.sh b/helper/bench/prepare.sh index 2ec3ad1..bde6b63 100755 --- a/helper/bench/prepare.sh +++ b/helper/bench/prepare.sh @@ -6,5 +6,5 @@ git clone https://github.com/dtm-labs/dtm.git && cd dtm && git checkout alpha && echo 'all prepared. you shoud run following commands to test in different terminal' echo -echo 'cd dtm && go run bench/main.go redis|boltdb|db' -echo 'cd dtm && bench/run-redis|boltdb|mysql.sh' +echo 'cd dtf && go run helper/bench/main.go redis|boltdb|db' +echo 'cd dtf/helper && bench/run-redis|boltdb|mysql.sh' diff --git a/helper/bench/svr/http.go b/helper/bench/svr/http.go index 76844d6..ef5c057 100644 --- a/helper/bench/svr/http.go +++ b/helper/bench/svr/http.go @@ -96,7 +96,7 @@ func PrepareBenchDB() { func StartSvr() { app := dtmutil.GetGinApp() benchAddRoute(app) - logger.Debugf("bench listening at %d", benchPort) + logger.Infof("bench listening at %s", benchPort) go func() { _ = app.Run(fmt.Sprintf(":%s", benchPort)) }() From f7debdd4d19a78c76bcb27274454b5ec47aaca9d Mon Sep 17 00:00:00 2001 From: KuiLiao Date: Tue, 29 Mar 2022 02:13:44 +0800 Subject: [PATCH 2/2] fix mysql error --- test/busi/startup.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/busi/startup.go b/test/busi/startup.go index 3181787..08de468 100644 --- a/test/busi/startup.go +++ b/test/busi/startup.go @@ -22,6 +22,8 @@ func PopulateDB(skipDrop bool) { dtmutil.RunSQLScript(BusiConf, file, skipDrop) file = fmt.Sprintf("%s/dtmcli.barrier.%s.sql", dtmutil.GetSQLDir(), BusiConf.Driver) dtmutil.RunSQLScript(BusiConf, file, skipDrop) + file = fmt.Sprintf("%s/dtmsvr.storage.%s.sql", dtmutil.GetSQLDir(), BusiConf.Driver) + dtmutil.RunSQLScript(BusiConf, file, skipDrop) _, err := RedisGet().FlushAll(context.Background()).Result() // redis barrier need clear dtmimp.E2P(err) SetRedisBothAccount(10000, 10000)