mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Remove investigation tricks+include fjl's feeback
This commit is contained in:
parent
d7187b285d
commit
486eb97e87
7 changed files with 8 additions and 55 deletions
11
.travis.yml
11
.travis.yml
|
|
@ -46,18 +46,9 @@ jobs:
|
||||||
arch: arm64
|
arch: arm64
|
||||||
dist: xenial
|
dist: xenial
|
||||||
go: 1.13.x
|
go: 1.13.x
|
||||||
env:
|
|
||||||
- GODEBUG="netdns=go+1"
|
|
||||||
script:
|
script:
|
||||||
- echo "test dns"
|
|
||||||
- cat /etc/resolv.conf
|
|
||||||
- ping -c 4 8.8.8.8
|
|
||||||
- ping -c 4 8.8.4.4
|
|
||||||
- ping -c 4 1.1.1.1
|
|
||||||
- ip address
|
|
||||||
- go test -v ./investigate/...
|
|
||||||
- go run build/ci.go install
|
- go run build/ci.go install
|
||||||
- go run build/ci.go test -coverage ./p2p/enode/...
|
- go run build/ci.go test -coverage $TEST_PACKAGES
|
||||||
|
|
||||||
- stage: build
|
- stage: build
|
||||||
os: osx
|
os: osx
|
||||||
|
|
|
||||||
|
|
@ -327,7 +327,7 @@ func doTest(cmdline []string) {
|
||||||
// Test a single package at a time. CI builders are slow
|
// Test a single package at a time. CI builders are slow
|
||||||
// and some tests run into timeouts under load.
|
// and some tests run into timeouts under load.
|
||||||
gotest := goTool("test", buildFlags(env)...)
|
gotest := goTool("test", buildFlags(env)...)
|
||||||
gotest.Args = append(gotest.Args, "-p", "1", "-timeout", "5m", "--short", "-v")
|
gotest.Args = append(gotest.Args, "-p", "1", "-timeout", "5m", "--short")
|
||||||
if *coverage {
|
if *coverage {
|
||||||
gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover")
|
gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
@ -33,12 +32,6 @@ import (
|
||||||
|
|
||||||
// Tests that ethash works correctly in test mode.
|
// Tests that ethash works correctly in test mode.
|
||||||
func TestTestMode(t *testing.T) {
|
func TestTestMode(t *testing.T) {
|
||||||
var timeoutS time.Duration
|
|
||||||
if runtime.GOARCH == "arm64" {
|
|
||||||
timeoutS = 2 * time.Second
|
|
||||||
} else {
|
|
||||||
timeoutS = time.Second
|
|
||||||
}
|
|
||||||
header := &types.Header{Number: big.NewInt(1), Difficulty: big.NewInt(100)}
|
header := &types.Header{Number: big.NewInt(1), Difficulty: big.NewInt(100)}
|
||||||
|
|
||||||
ethash := NewTester(nil, false)
|
ethash := NewTester(nil, false)
|
||||||
|
|
@ -56,7 +49,7 @@ func TestTestMode(t *testing.T) {
|
||||||
if err := ethash.VerifySeal(nil, header); err != nil {
|
if err := ethash.VerifySeal(nil, header); err != nil {
|
||||||
t.Fatalf("unexpected verification error: %v", err)
|
t.Fatalf("unexpected verification error: %v", err)
|
||||||
}
|
}
|
||||||
case <-time.NewTimer(timeoutS).C:
|
case <-time.NewTimer(2 * time.Second).C:
|
||||||
t.Error("sealing result timeout")
|
t.Error("sealing result timeout")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ import (
|
||||||
"math"
|
"math"
|
||||||
"math/big"
|
"math/big"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"runtime"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -609,13 +608,7 @@ func testBroadcastBlock(t *testing.T, totalPeers, broadcastExpected int) {
|
||||||
}
|
}
|
||||||
}(peer)
|
}(peer)
|
||||||
}
|
}
|
||||||
var timeoutMs time.Duration
|
timeout := time.After(time.Second)
|
||||||
if runtime.GOARCH == "arm64" {
|
|
||||||
timeoutMs = time.Second
|
|
||||||
} else {
|
|
||||||
timeoutMs = 300 * time.Millisecond
|
|
||||||
}
|
|
||||||
timeout := time.After(timeoutMs)
|
|
||||||
var receivedCount int
|
var receivedCount int
|
||||||
outer:
|
outer:
|
||||||
for {
|
for {
|
||||||
|
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
package investigate
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"net"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestDNS(t *testing.T) {
|
|
||||||
for i := 0; i < 100; i++ {
|
|
||||||
ips, err := net.LookupIP("invalid.")
|
|
||||||
fmt.Println(i, "result", ips, "err", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -19,7 +19,6 @@ package miner
|
||||||
import (
|
import (
|
||||||
"math/big"
|
"math/big"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"runtime"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -343,11 +342,7 @@ func testEmptyWork(t *testing.T, chainConfig *params.ChainConfig, engine consens
|
||||||
w.fullTaskHook = func() {
|
w.fullTaskHook = func() {
|
||||||
// Aarch64 unit tests are running in a VM on travis, they must
|
// Aarch64 unit tests are running in a VM on travis, they must
|
||||||
// be given more time to execute.
|
// be given more time to execute.
|
||||||
if runtime.GOARCH == "arm64" {
|
time.Sleep(time.Second)
|
||||||
time.Sleep(1000 * time.Millisecond)
|
|
||||||
} else {
|
|
||||||
time.Sleep(100 * time.Millisecond)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure worker has finished initialization
|
// Ensure worker has finished initialization
|
||||||
|
|
@ -358,18 +353,11 @@ func testEmptyWork(t *testing.T, chainConfig *params.ChainConfig, engine consens
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var timeoutS time.Duration
|
|
||||||
if runtime.GOARCH == "arm64" {
|
|
||||||
timeoutS = 4 * time.Second
|
|
||||||
} else {
|
|
||||||
timeoutS = 2 * time.Second
|
|
||||||
}
|
|
||||||
|
|
||||||
w.start()
|
w.start()
|
||||||
for i := 0; i < 2; i += 1 {
|
for i := 0; i < 2; i += 1 {
|
||||||
select {
|
select {
|
||||||
case <-taskCh:
|
case <-taskCh:
|
||||||
case <-time.NewTimer(timeoutS).C:
|
case <-time.NewTimer(4 * time.Second).C:
|
||||||
t.Error("new task timeout")
|
t.Error("new task timeout")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,12 +71,14 @@ func MustParseV4(rawurl string) *Node {
|
||||||
// enode://<hex node id>@10.3.58.6:30303?discport=30301
|
// enode://<hex node id>@10.3.58.6:30303?discport=30301
|
||||||
func ParseV4(rawurl string) (*Node, error) {
|
func ParseV4(rawurl string) (*Node, error) {
|
||||||
if m := incompleteNodeURL.FindStringSubmatch(rawurl); m != nil {
|
if m := incompleteNodeURL.FindStringSubmatch(rawurl); m != nil {
|
||||||
|
fmt.Println("m != nil")
|
||||||
id, err := parsePubkey(m[1])
|
id, err := parsePubkey(m[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("invalid public key (%v)", err)
|
return nil, fmt.Errorf("invalid public key (%v)", err)
|
||||||
}
|
}
|
||||||
return NewV4(id, nil, 0, 0), nil
|
return NewV4(id, nil, 0, 0), nil
|
||||||
}
|
}
|
||||||
|
fmt.Println("parse complete")
|
||||||
return parseComplete(rawurl)
|
return parseComplete(rawurl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue