Skip to content

Commit

Permalink
wait until done
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazar955 committed Sep 14, 2024
1 parent b41340f commit ded4458
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions e2etest/reporter_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func TestReporter_BoostrapUnderFrequentBTCHeaders(t *testing.T) {
// start a routine that mines BTC blocks very fast
var wg sync.WaitGroup
stopChan := make(chan struct{})
doneChan := make(chan struct{})

wg.Add(1)
go func() {
Expand All @@ -95,6 +96,7 @@ func TestReporter_BoostrapUnderFrequentBTCHeaders(t *testing.T) {
case <-ticker.C:
tm.BitcoindHandler.GenerateBlocks(1)
case <-stopChan:
close(doneChan)
return
}
}
Expand All @@ -113,6 +115,7 @@ func TestReporter_BoostrapUnderFrequentBTCHeaders(t *testing.T) {
}, longEventuallyWaitTimeOut, eventuallyPollTime)

close(stopChan)
<-doneChan
wg.Wait()
}

Expand Down

0 comments on commit ded4458

Please sign in to comment.