Browse Source

fix tests

pull/516/head
Ethan Buchman 8 years ago
parent
commit
bd7ec18c19
7 changed files with 21 additions and 12 deletions
  1. +1
    -1
      cmd/tendermint/commands/flags/log_level.go
  2. +10
    -1
      config/config.go
  3. +1
    -1
      rpc/client/rpc_test.go
  4. +6
    -6
      rpc/test/helpers.go
  5. +1
    -1
      state/execution.go
  6. +1
    -1
      test/app/test.sh
  7. +1
    -1
      test/persist/test_failure_indices.sh

+ 1
- 1
cmd/tendermint/commands/flags/log_level.go View File

@ -76,7 +76,7 @@ func ParseLogLevel(lvl string, logger log.Logger) (log.Logger, error) {
// if "*" is not provided, set default global level
if !isDefaultLogLevelSet {
option, err = log.AllowLevel(cfg.DefaultBaseConfig().LogLevel)
option, err = log.AllowLevel(cfg.DefaultLogLevel())
if err != nil {
return nil, err
}


+ 10
- 1
config/config.go View File

@ -1,6 +1,7 @@
package config
import (
"fmt"
"path/filepath"
"time"
@ -108,7 +109,7 @@ func DefaultBaseConfig() BaseConfig {
Moniker: "anonymous",
ProxyApp: "tcp://127.0.0.1:46658",
ABCI: "socket",
LogLevel: "state:info,*:error",
LogLevel: DefaultPackageLogLevels(),
ProfListenAddress: "",
FastSync: true,
FilterPeers: false,
@ -139,6 +140,14 @@ func (b BaseConfig) DBDir() string {
return rootify(b.DBPath, b.RootDir)
}
func DefaultLogLevel() string {
return "error"
}
func DefaultPackageLogLevels() string {
return fmt.Sprintf("state:info,*:%s", DefaultLogLevel())
}
//-----------------------------------------------------------------------------
// RPCConfig


+ 1
- 1
rpc/client/rpc_test.go View File

@ -13,7 +13,7 @@ import (
)
func getHTTPClient() *client.HTTP {
rpcAddr := rpctest.GetConfig().RPCListenAddress
rpcAddr := rpctest.GetConfig().RPC.ListenAddress
return client.NewHTTP(rpcAddr, "/websocket")
}


+ 6
- 6
rpc/test/helpers.go View File

@ -59,31 +59,31 @@ func GetConfig() *cfg.Config {
// and we use random ports to run in parallel
tm, rpc, grpc := makeAddrs()
config.P2P.ListenAddress = tm
config.RPCListenAddress = rpc
config.GRPCListenAddress = grpc
config.RPC.ListenAddress = rpc
config.RPC.GRPCListenAddress = grpc
}
return config
}
// GetURIClient gets a uri client pointing to the test tendermint rpc
func GetURIClient() *client.URIClient {
rpcAddr := GetConfig().RPCListenAddress
rpcAddr := GetConfig().RPC.ListenAddress
return client.NewURIClient(rpcAddr)
}
// GetJSONClient gets a http/json client pointing to the test tendermint rpc
func GetJSONClient() *client.JSONRPCClient {
rpcAddr := GetConfig().RPCListenAddress
rpcAddr := GetConfig().RPC.ListenAddress
return client.NewJSONRPCClient(rpcAddr)
}
func GetGRPCClient() core_grpc.BroadcastAPIClient {
grpcAddr := config.GRPCListenAddress
grpcAddr := config.RPC.GRPCListenAddress
return core_grpc.StartGRPCClient(grpcAddr)
}
func GetWSClient() *client.WSClient {
rpcAddr := GetConfig().RPCListenAddress
rpcAddr := GetConfig().RPC.ListenAddress
wsc := client.NewWSClient(rpcAddr, "/websocket")
if _, err := wsc.Start(); err != nil {
panic(err)


+ 1
- 1
state/execution.go View File

@ -259,7 +259,7 @@ func (s *State) CommitStateUpdateMempool(proxyAppConn proxy.AppConnConsensus, bl
s.logger.Debug("Commit.Log: " + res.Log)
}
s.logger.Info("Committed state", "height", block.Height, "hash", res.Data)
s.logger.Info("Committed state", "height", block.Height, "txs", block.NumTxs, "hash", res.Data)
// Set the state's new AppHash
s.AppHash = res.Data


+ 1
- 1
test/app/test.sh View File

@ -85,7 +85,7 @@ function counter_over_grpc_grpc() {
pid_counter=$!
sleep 1
GRPC_PORT=36656
tendermint node --abci grpc --grpc_laddr tcp://localhost:$GRPC_PORT > tendermint.log &
tendermint node --abci grpc --rpc.grpc_laddr tcp://localhost:$GRPC_PORT > tendermint.log &
pid_tendermint=$!
sleep 5


+ 1
- 1
test/persist/test_failure_indices.sh View File

@ -8,7 +8,7 @@ tendermint init
# use a unix socket so we can remove it
RPC_ADDR="$(pwd)/rpc.sock"
TM_CMD="tendermint node --log_level=debug --rpc_laddr=unix://$RPC_ADDR" # &> tendermint_${name}.log"
TM_CMD="tendermint node --log_level=debug --rpc.laddr=unix://$RPC_ADDR" # &> tendermint_${name}.log"
DUMMY_CMD="dummy --persist $TMHOME/dummy" # &> dummy_${name}.log"


Loading…
Cancel
Save