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
7961ff3e62
commit
adfc1ef5d1
2 changed files with 10 additions and 8 deletions
|
|
@ -495,13 +495,13 @@ func (f *Firehose) OnBlockEnd(err error) {
|
|||
f.fixOrdinalsForEndOfBlockChanges()
|
||||
}
|
||||
|
||||
// f.printBlockToFirehose(f.block, f.blockFinality)
|
||||
f.ensureInBlockAndNotInTrx()
|
||||
f.printBlockToFirehose(f.block, f.blockFinality)
|
||||
//job := &blockPrintJob{
|
||||
// block: f.block,
|
||||
// finality: f.blockFinality,
|
||||
//}
|
||||
//f.blockPrintQueue <- job
|
||||
job := &blockPrintJob{
|
||||
block: f.block,
|
||||
finality: f.blockFinality,
|
||||
}
|
||||
f.blockPrintQueue <- job
|
||||
|
||||
} else {
|
||||
// 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"
|
||||
)
|
||||
|
||||
func TestFirehose_BlockPrintsToFirehoseInOrder(t *testing.T) {
|
||||
func TestFirehose_BlockPrintsToFirehose_SingleBlock(t *testing.T) {
|
||||
f := NewFirehose(&FirehoseConfig{
|
||||
ApplyBackwardCompatibility: ptr(false),
|
||||
private: &privateFirehoseConfig{
|
||||
|
|
@ -38,6 +38,8 @@ func TestFirehose_BlockPrintsToFirehoseInOrder(t *testing.T) {
|
|||
f.OnBlockEnd(nil)
|
||||
}
|
||||
|
||||
f.Shutdown()
|
||||
|
||||
output := f.InternalTestingBuffer().String()
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
func TestFirehose_BlocksPrintToFirehoseInOrder(t *testing.T) {
|
||||
func TestFirehose_BlocksPrintToFirehose_MultipleBlocksInOrder(t *testing.T) {
|
||||
|
||||
const blockCount = 100
|
||||
const baseBlockNum = 1000
|
||||
|
|
|
|||
Loading…
Reference in a new issue