mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
TEST: All unit tests for concurrency pass
This commit is contained in:
parent
6634465edb
commit
a465709da4
2 changed files with 10 additions and 8 deletions
|
|
@ -495,13 +495,13 @@ func (f *Firehose) OnBlockEnd(err error) {
|
||||||
f.fixOrdinalsForEndOfBlockChanges()
|
f.fixOrdinalsForEndOfBlockChanges()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// f.printBlockToFirehose(f.block, f.blockFinality)
|
||||||
f.ensureInBlockAndNotInTrx()
|
f.ensureInBlockAndNotInTrx()
|
||||||
f.printBlockToFirehose(f.block, f.blockFinality)
|
job := &blockPrintJob{
|
||||||
//job := &blockPrintJob{
|
block: f.block,
|
||||||
// block: f.block,
|
finality: f.blockFinality,
|
||||||
// finality: f.blockFinality,
|
}
|
||||||
//}
|
f.blockPrintQueue <- job
|
||||||
//f.blockPrintQueue <- job
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// An error occurred, could have happen in transaction/call context, we must not check if in trx/call, only check in block
|
// An error occurred, could have happen in transaction/call context, we must not check if in trx/call, only check in block
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFirehose_BlockPrintsToFirehoseInOrder(t *testing.T) {
|
func TestFirehose_BlockPrintsToFirehose_SingleBlock(t *testing.T) {
|
||||||
f := NewFirehose(&FirehoseConfig{
|
f := NewFirehose(&FirehoseConfig{
|
||||||
ApplyBackwardCompatibility: ptr(false),
|
ApplyBackwardCompatibility: ptr(false),
|
||||||
private: &privateFirehoseConfig{
|
private: &privateFirehoseConfig{
|
||||||
|
|
@ -38,6 +38,8 @@ func TestFirehose_BlockPrintsToFirehoseInOrder(t *testing.T) {
|
||||||
f.OnBlockEnd(nil)
|
f.OnBlockEnd(nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
f.Shutdown()
|
||||||
|
|
||||||
output := f.InternalTestingBuffer().String()
|
output := f.InternalTestingBuffer().String()
|
||||||
|
|
||||||
require.Contains(t, output, "FIRE BLOCK", "expected FIRE BLOCK output not found")
|
require.Contains(t, output, "FIRE BLOCK", "expected FIRE BLOCK output not found")
|
||||||
|
|
@ -59,7 +61,7 @@ func TestFirehose_BlockPrintsToFirehoseInOrder(t *testing.T) {
|
||||||
"Block 124 should appear before block 125 in output")
|
"Block 124 should appear before block 125 in output")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFirehose_BlocksPrintToFirehoseInOrder(t *testing.T) {
|
func TestFirehose_BlocksPrintToFirehose_MultipleBlocksInOrder(t *testing.T) {
|
||||||
|
|
||||||
const blockCount = 100
|
const blockCount = 100
|
||||||
const baseBlockNum = 1000
|
const baseBlockNum = 1000
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue