Remove investigation tricks+include fjl's feeback

This commit is contained in:
Guillaume Ballet 2019-11-05 11:57:06 +01:00
parent d7187b285d
commit 486eb97e87
7 changed files with 8 additions and 55 deletions

View file

@ -46,18 +46,9 @@ jobs:
arch: arm64
dist: xenial
go: 1.13.x
env:
- GODEBUG="netdns=go+1"
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 test -coverage ./p2p/enode/...
- go run build/ci.go test -coverage $TEST_PACKAGES
- stage: build
os: osx

View file

@ -327,7 +327,7 @@ func doTest(cmdline []string) {
// Test a single package at a time. CI builders are slow
// and some tests run into timeouts under load.
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 {
gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover")
}

View file

@ -21,7 +21,6 @@ import (
"math/big"
"math/rand"
"os"
"runtime"
"sync"
"testing"
"time"
@ -33,12 +32,6 @@ import (
// Tests that ethash works correctly in test mode.
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)}
ethash := NewTester(nil, false)
@ -56,7 +49,7 @@ func TestTestMode(t *testing.T) {
if err := ethash.VerifySeal(nil, header); err != nil {
t.Fatalf("unexpected verification error: %v", err)
}
case <-time.NewTimer(timeoutS).C:
case <-time.NewTimer(2 * time.Second).C:
t.Error("sealing result timeout")
}
}

View file

@ -21,7 +21,6 @@ import (
"math"
"math/big"
"math/rand"
"runtime"
"testing"
"time"
@ -609,13 +608,7 @@ func testBroadcastBlock(t *testing.T, totalPeers, broadcastExpected int) {
}
}(peer)
}
var timeoutMs time.Duration
if runtime.GOARCH == "arm64" {
timeoutMs = time.Second
} else {
timeoutMs = 300 * time.Millisecond
}
timeout := time.After(timeoutMs)
timeout := time.After(time.Second)
var receivedCount int
outer:
for {

View file

@ -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)
}
}

View file

@ -19,7 +19,6 @@ package miner
import (
"math/big"
"math/rand"
"runtime"
"testing"
"time"
@ -343,11 +342,7 @@ func testEmptyWork(t *testing.T, chainConfig *params.ChainConfig, engine consens
w.fullTaskHook = func() {
// Aarch64 unit tests are running in a VM on travis, they must
// be given more time to execute.
if runtime.GOARCH == "arm64" {
time.Sleep(1000 * time.Millisecond)
} else {
time.Sleep(100 * time.Millisecond)
}
time.Sleep(time.Second)
}
// 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()
for i := 0; i < 2; i += 1 {
select {
case <-taskCh:
case <-time.NewTimer(timeoutS).C:
case <-time.NewTimer(4 * time.Second).C:
t.Error("new task timeout")
}
}

View file

@ -71,12 +71,14 @@ func MustParseV4(rawurl string) *Node {
// enode://<hex node id>@10.3.58.6:30303?discport=30301
func ParseV4(rawurl string) (*Node, error) {
if m := incompleteNodeURL.FindStringSubmatch(rawurl); m != nil {
fmt.Println("m != nil")
id, err := parsePubkey(m[1])
if err != nil {
return nil, fmt.Errorf("invalid public key (%v)", err)
}
return NewV4(id, nil, 0, 0), nil
}
fmt.Println("parse complete")
return parseComplete(rawurl)
}