Commit 93752812 authored by vipwzw's avatar vipwzw

auto ci

parent 8fd20a22
......@@ -368,7 +368,7 @@ OuterLoop:
csState.SetPrivValidator(client.privValidator, client.ValidatorIndex())
// Create & add listener
protocol, listeningAddress := "tcp", "0.0.0.0:" + dposPort
protocol, listeningAddress := "tcp", "0.0.0.0:"+dposPort
node := NewNode(validatorNodes, protocol, listeningAddress, client.privKey, valMgr.ChainID, dposVersion, csState)
client.node = node
......@@ -772,6 +772,6 @@ func (client *Client) SetTestFlag() {
}
// GetNode return the pointer to Node
func (client *Client) GetNode() *Node{
func (client *Client) GetNode() *Node {
return client.node
}
......@@ -197,7 +197,7 @@ func (node *Node) Start(testFlag bool) {
addr := node.seeds[i]
ip, _ := splitHostPort(addr)
_, ok := node.localIPs[ip]
if ok && !testFlag{
if ok && !testFlag {
dposlog.Info("find our ip ", "ourip", ip)
node.IP = ip
return
......
......@@ -5,6 +5,12 @@ import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"os"
"sync"
"testing"
"time"
"github.com/33cn/chain33/common/crypto"
"github.com/33cn/chain33/executor"
"github.com/33cn/chain33/p2p"
......@@ -13,11 +19,6 @@ import (
"github.com/33cn/chain33/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"io/ioutil"
"os"
"sync"
"testing"
"time"
"github.com/33cn/chain33/blockchain"
"github.com/33cn/chain33/mempool"
......@@ -190,7 +191,7 @@ cryptoPath="authdir/crypto"
# 带证书签名类型,支持"auth_ecdsa", "auth_sm2"
signType="auth_ecdsa"
`
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
config2 = `Title="local"
[log]
......@@ -365,6 +366,7 @@ cryptoPath="authdir/crypto"
signType="auth_ecdsa"
`
)
func init() {
cr2, err := crypto.New(types.GetSignName("", types.ED25519))
if err != nil {
......@@ -398,19 +400,18 @@ func Init() {
ioutil.WriteFile("chain33.test2.toml", []byte(config2), 0664)
}
func TestParallel(t *testing.T) {
Parallel(func () {
Parallel(func() {
mutx.Lock()
sum += 1
mutx.Unlock()
},
func () {
func() {
mutx.Lock()
sum += 2
mutx.Unlock()
},
func () {
func() {
mutx.Lock()
sum += 3
mutx.Unlock()
......@@ -500,7 +501,6 @@ func TestNode(t *testing.T) {
require.Nil(t, cs1.(*Client).GetNode().CompatibleWith(nodeinfo))
fmt.Println("TestNodeCompatibleWith ok")
//time.Sleep(2 * time.Second)
fmt.Println(q1.Name())
......@@ -532,7 +532,6 @@ func TestNode(t *testing.T) {
fmt.Println("======= cs1 is not running=======")
}
//cs2.(*Client).StopC()
if cs2.(*Client).GetNode().IsRunning() {
fmt.Println("=======cs2 is running=======")
......@@ -568,7 +567,6 @@ func clearTestData1() {
fmt.Println("test data clear successfully!")
}
func initEnvDpos1(configName string) (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Module, *executor.Executor, queue.Module, queue.Module) {
var q = queue.New("channel")
flag.Parse()
......@@ -625,7 +623,6 @@ func initEnvDpos2(configName string) (queue.Queue, *blockchain.BlockChain, queue
cs.(*Client).SetTestFlag()
cs.SetQueueClient(q.Client())
mem := mempool.New(cfg.Mempool, nil)
mem.SetQueueClient(q.Client())
network := p2p.New(cfg.P2P)
......@@ -638,4 +635,3 @@ func initEnvDpos2(configName string) (queue.Queue, *blockchain.BlockChain, queue
return q, chain, s, mem, exec, cs, network
}
......@@ -10,11 +10,12 @@ import (
"encoding/hex"
"encoding/json"
"errors"
"github.com/33cn/chain33/common/address"
"io/ioutil"
"os"
"sync"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
vrf "github.com/33cn/chain33/common/vrf/secp256k1"
"github.com/33cn/chain33/types"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment