Skip to content

Commit 46bebd3

Browse files
authored
Merge pull request #1917 from jtobin/tapgarden-finalize
tapgarden: wait for finalizebatch to complete
2 parents ed193ca + ca08ed1 commit 46bebd3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tapgarden/planter_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,11 @@ func (t *mintingTestHarness) finalizeBatchAssertFrozen(
591591
t.finalizeBatch(&wg, respChan, nil)
592592

593593
if noBatch {
594+
// Wait for the FinalizeBatch goroutine to complete before
595+
// returning. This prevents a race where the goroutine's
596+
// stateReqs message could interleave with subsequent seedling
597+
// requests, potentially corrupting batch state.
598+
wg.Wait()
594599
t.assertNoPendingBatch()
595600
return nil
596601
}

0 commit comments

Comments
 (0)