TEST: All unit tests for concurrency pass

This commit is contained in:
David Zhou 2025-05-09 13:05:40 -04:00
parent 7961ff3e62
commit adfc1ef5d1
2 changed files with 10 additions and 8 deletions

View file

@ -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

View file

@ -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