core, ethclient/gethclient: improve flaky tests (#25918)

* ethclient/gethclient: improve time-sensitive flaky test

* eth/catalyst: fix (?) flaky test

* core: stop blockchains in tests after use

* core: fix dangling blockchain instances

* core: rm whitespace

* eth/gasprice, eth/tracers, consensus/clique: stop dangling blockchains in tests

* all: address review concerns

* core: goimports

* eth/catalyst: fix another time-sensitive test

* consensus/clique: add snapshot test run function

* core: rename stop() to stopWithoutSaving()

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
Martin Holst Swende
2022-10-06 13:39:20 +02:00
committed by GitHub
co-authored by Felix Lange
parent deead99731
commit 067bac3f24
12 changed files with 265 additions and 158 deletions
+8 -5
View File
@@ -106,10 +106,6 @@ func TestGethClient(t *testing.T) {
name string
test func(t *testing.T)
}{
{
"TestAccessList",
func(t *testing.T) { testAccessList(t, client) },
},
{
"TestGetProof",
func(t *testing.T) { testGetProof(t, client) },
@@ -132,8 +128,15 @@ func TestGethClient(t *testing.T) {
"TestCallContract",
func(t *testing.T) { testCallContract(t, client) },
},
// The testaccesslist is a bit time-sensitive: the newTestBackend imports
// one block. The `testAcessList` fails if the miner has not yet created a
// new pending-block after the import event.
// Hence: this test should be last, execute the tests serially.
{
"TestAccessList",
func(t *testing.T) { testAccessList(t, client) },
},
}
t.Parallel()
for _, tt := range tests {
t.Run(tt.name, tt.test)
}