mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-13 23:43:47 +00:00
rm : interrupt + sleep
This commit is contained in:
parent
5067c6cdeb
commit
a2dc545fac
1 changed files with 0 additions and 21 deletions
|
|
@ -8,7 +8,6 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"math/big"
|
"math/big"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -133,10 +132,6 @@ func TestValidatorWentOffline(t *testing.T) {
|
||||||
// Create an Ethash network based off of the Ropsten config
|
// Create an Ethash network based off of the Ropsten config
|
||||||
genesis := initGenesis(t, faucets)
|
genesis := initGenesis(t, faucets)
|
||||||
|
|
||||||
// Handle interrupts.
|
|
||||||
interruptCh := make(chan os.Signal, 5)
|
|
||||||
signal.Notify(interruptCh, os.Interrupt)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
stacks []*node.Node
|
stacks []*node.Node
|
||||||
nodes []*eth.Ethereum
|
nodes []*eth.Ethereum
|
||||||
|
|
@ -171,20 +166,6 @@ func TestValidatorWentOffline(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
|
||||||
for {
|
|
||||||
// Stop when interrupted.
|
|
||||||
select {
|
|
||||||
case <-interruptCh:
|
|
||||||
for _, node := range stacks {
|
|
||||||
node.Close()
|
|
||||||
}
|
|
||||||
return
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
|
||||||
// for block 1 to 8, the primary validator is node0
|
// for block 1 to 8, the primary validator is node0
|
||||||
|
|
@ -212,8 +193,6 @@ func TestValidatorWentOffline(t *testing.T) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(1 * time.Second)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check block 10 miner ; expected author is node1 signer
|
// check block 10 miner ; expected author is node1 signer
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue