Skip to content

Commit

Permalink
Add debug stack trace to help track down failures
Browse files Browse the repository at this point in the history
It seems that very occasionally we are hitting this error condition
and its not clear why.
  • Loading branch information
piersy committed Dec 15, 2021
1 parent 704ec7d commit 7c46396
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/tracker.go
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"runtime/debug"
"sync"

ethereum "github.com/celo-org/celo-blockchain"
Expand Down Expand Up @@ -192,7 +193,7 @@ func (tr *Tracker) await(ctx context.Context, condition func() bool) error {
// StopTracking shuts down all the goroutines in the tracker.
func (tr *Tracker) StopTracking() error {
if tr.sub == nil {
return errors.New("attempted to stop already stopped tracker")
return fmt.Errorf("attempted to stop already stopped tracker - stack: \n%s", string(debug.Stack()))
}
tr.sub.Unsubscribe()
close(tr.stopCh)
Expand Down

0 comments on commit 7c46396

Please sign in to comment.