mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
increase timeout in tests for arm64
This commit is contained in:
parent
f87c2746d7
commit
7d56acbda4
4 changed files with 26 additions and 4 deletions
|
|
@ -46,8 +46,9 @@ jobs:
|
|||
arch: arm64
|
||||
dist: xenial
|
||||
go: 1.13.x
|
||||
env:
|
||||
- GODEBUG="netdns=cgo"
|
||||
script:
|
||||
- export GODEBUG=netdns=cgo
|
||||
- go run build/ci.go install
|
||||
- go run build/ci.go test -coverage $TEST_PACKAGES
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import (
|
|||
"math/big"
|
||||
"math/rand"
|
||||
"os"
|
||||
"runtime"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
|
@ -32,6 +33,12 @@ 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)
|
||||
|
|
@ -49,7 +56,7 @@ func TestTestMode(t *testing.T) {
|
|||
if err := ethash.VerifySeal(nil, header); err != nil {
|
||||
t.Fatalf("unexpected verification error: %v", err)
|
||||
}
|
||||
case <-time.NewTimer(time.Second).C:
|
||||
case <-time.NewTimer(timeoutS).C:
|
||||
t.Error("sealing result timeout")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import (
|
|||
"math"
|
||||
"math/big"
|
||||
"math/rand"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
|
@ -608,7 +609,13 @@ func testBroadcastBlock(t *testing.T, totalPeers, broadcastExpected int) {
|
|||
}
|
||||
}(peer)
|
||||
}
|
||||
timeout := time.After(300 * time.Millisecond)
|
||||
var timeoutMs time.Duration
|
||||
if runtime.GOARCH == "arm64" {
|
||||
timeoutMs = time.Second
|
||||
} else {
|
||||
timeoutMs = 300 * time.Millisecond
|
||||
}
|
||||
timeout := time.After(timeoutMs)
|
||||
var receivedCount int
|
||||
outer:
|
||||
for {
|
||||
|
|
|
|||
|
|
@ -358,11 +358,18 @@ 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(2 * time.Second).C:
|
||||
case <-time.NewTimer(timeoutS).C:
|
||||
t.Error("new task timeout")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue