Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(e2e): wait until go routine is done #49

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading