mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
PR: Part 2
This commit is contained in:
parent
326a3ee583
commit
a1e2e8f291
1 changed files with 14 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package firehose_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
|
@ -41,9 +42,13 @@ func TestFirehosePrestate(t *testing.T) {
|
|||
for _, concurrent := range []bool{true, false} {
|
||||
for _, folder := range testFolders {
|
||||
name := filepath.Base(folder)
|
||||
concurrencyLabel := "sequential"
|
||||
if concurrent {
|
||||
concurrencyLabel = "concurrent"
|
||||
}
|
||||
|
||||
for _, model := range tracingModels {
|
||||
t.Run(string(model)+"/"+name, func(t *testing.T) {
|
||||
t.Run(fmt.Sprintf("%s/%s/%s", model, name, concurrencyLabel), func(t *testing.T) {
|
||||
tracer, tracingHooks, onClose := newFirehoseTestTracer(t, model, concurrent)
|
||||
defer onClose()
|
||||
|
||||
|
|
@ -52,7 +57,8 @@ func TestFirehosePrestate(t *testing.T) {
|
|||
tracer.CloseBlockPrintQueue()
|
||||
|
||||
genesisLine, blockLines, unknownLines := readTracerFirehoseLines(t, tracer)
|
||||
require.Len(t, unknownLines, 0, "Lines:\n%s", strings.Join(slicesMap(unknownLines, func(l unknownLine) string { return "- '" + string(l) + "'" }), "\n"))
|
||||
require.Len(t, unknownLines, 0, "Lines:\n%s", strings.Join(
|
||||
slicesMap(unknownLines, func(l unknownLine) string { return "- '" + string(l) + "'" }), "\n"))
|
||||
require.NotNil(t, genesisLine)
|
||||
blockLines.assertOnlyBlockEquals(t, filepath.Join(folder, string(model)), 1)
|
||||
})
|
||||
|
|
@ -189,8 +195,13 @@ func testBlockTracesCorrectly(t *testing.T, genesisSpec *core.Genesis, engine co
|
|||
t.Helper()
|
||||
|
||||
for _, concurrent := range []bool{true, false} {
|
||||
concurrencyLabel := "sequential"
|
||||
if concurrent {
|
||||
concurrencyLabel = "concurrent"
|
||||
}
|
||||
|
||||
for _, model := range tracingModels {
|
||||
t.Run(string(model), func(t *testing.T) {
|
||||
t.Run(fmt.Sprintf("%s/%s", model, concurrencyLabel), func(t *testing.T) {
|
||||
tracer, tracingHooks, onClose := newFirehoseTestTracer(t, model, concurrent)
|
||||
defer onClose()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue