forked from forks/go-ethereum
cmd/geth, internal: fix flaky console tests (#31784)
This pull request bumps the timeout for flaky console tests on appveyor.
This commit is contained in:
parent
10519768a2
commit
181dd2e660
3 changed files with 15 additions and 11 deletions
|
|
@ -102,17 +102,17 @@ func TestAttachWelcome(t *testing.T) {
|
||||||
"--http", "--http.port", httpPort,
|
"--http", "--http.port", httpPort,
|
||||||
"--ws", "--ws.port", wsPort)
|
"--ws", "--ws.port", wsPort)
|
||||||
t.Run("ipc", func(t *testing.T) {
|
t.Run("ipc", func(t *testing.T) {
|
||||||
waitForEndpoint(t, ipc, 4*time.Second)
|
waitForEndpoint(t, ipc, 2*time.Minute)
|
||||||
testAttachWelcome(t, geth, "ipc:"+ipc, ipcAPIs)
|
testAttachWelcome(t, geth, "ipc:"+ipc, ipcAPIs)
|
||||||
})
|
})
|
||||||
t.Run("http", func(t *testing.T) {
|
t.Run("http", func(t *testing.T) {
|
||||||
endpoint := "http://127.0.0.1:" + httpPort
|
endpoint := "http://127.0.0.1:" + httpPort
|
||||||
waitForEndpoint(t, endpoint, 4*time.Second)
|
waitForEndpoint(t, endpoint, 2*time.Minute)
|
||||||
testAttachWelcome(t, geth, endpoint, httpAPIs)
|
testAttachWelcome(t, geth, endpoint, httpAPIs)
|
||||||
})
|
})
|
||||||
t.Run("ws", func(t *testing.T) {
|
t.Run("ws", func(t *testing.T) {
|
||||||
endpoint := "ws://127.0.0.1:" + wsPort
|
endpoint := "ws://127.0.0.1:" + wsPort
|
||||||
waitForEndpoint(t, endpoint, 4*time.Second)
|
waitForEndpoint(t, endpoint, 2*time.Minute)
|
||||||
testAttachWelcome(t, geth, endpoint, httpAPIs)
|
testAttachWelcome(t, geth, endpoint, httpAPIs)
|
||||||
})
|
})
|
||||||
geth.Kill()
|
geth.Kill()
|
||||||
|
|
|
||||||
|
|
@ -134,13 +134,17 @@ func TestSendTx(t *testing.T) {
|
||||||
func testSendTx(t *testing.T, withLocal bool) {
|
func testSendTx(t *testing.T, withLocal bool) {
|
||||||
b := initBackend(withLocal)
|
b := initBackend(withLocal)
|
||||||
|
|
||||||
txA := pricedSetCodeTx(0, 250000, uint256.NewInt(params.GWei), uint256.NewInt(params.GWei), key, []unsignedAuth{
|
txA := pricedSetCodeTx(0, 250000, uint256.NewInt(params.GWei), uint256.NewInt(params.GWei), key, []unsignedAuth{{nonce: 0, key: key}})
|
||||||
{
|
if err := b.SendTx(context.Background(), txA); err != nil {
|
||||||
nonce: 0,
|
t.Fatalf("Failed to submit tx: %v", err)
|
||||||
key: key,
|
}
|
||||||
},
|
for {
|
||||||
})
|
pending, _ := b.TxPool().ContentFrom(address)
|
||||||
b.SendTx(context.Background(), txA)
|
if len(pending) == 1 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
time.Sleep(100 * time.Millisecond)
|
||||||
|
}
|
||||||
|
|
||||||
txB := makeTx(1, nil, nil, key)
|
txB := makeTx(1, nil, nil, key)
|
||||||
err := b.SendTx(context.Background(), txB)
|
err := b.SendTx(context.Background(), txB)
|
||||||
|
|
|
||||||
|
|
@ -237,7 +237,7 @@ func (tt *TestCmd) Kill() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tt *TestCmd) withKillTimeout(fn func()) {
|
func (tt *TestCmd) withKillTimeout(fn func()) {
|
||||||
timeout := time.AfterFunc(30*time.Second, func() {
|
timeout := time.AfterFunc(2*time.Minute, func() {
|
||||||
tt.Log("killing the child process (timeout)")
|
tt.Log("killing the child process (timeout)")
|
||||||
tt.Kill()
|
tt.Kill()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue