Skip to content

Commit

Permalink
dkg: fixing TestSyncFlow (#3410)
Browse files Browse the repository at this point in the history
Another attempt to fix TestSyncFlow flakey test.

category: fixbuild
ticket: none
  • Loading branch information
pinebit authored Dec 11, 2024
1 parent b84b636 commit 6852b93
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dkg/dkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ func (c *connTracker) AwaitN(t *testing.T, dkgErrChan chan error, n int, peerIdx
ticker := time.NewTicker(time.Millisecond * 100)
defer ticker.Stop()

timeout := time.NewTimer(time.Second * 5)
timeout := time.NewTimer(time.Second * 10)
defer timeout.Stop()

for {
Expand Down Expand Up @@ -655,8 +655,12 @@ func startNewDKG(t *testing.T, parentCtx context.Context, config dkg.Config, dkg
ctx, cancel := context.WithCancel(parentCtx)

go func() {
jitter := time.Duration(rand.Intn(300)) * time.Millisecond
time.Sleep(jitter)

err := dkg.Run(ctx, config)
log.Info(ctx, "DKG process returned", z.Any("error", err))

select {
case <-parentCtx.Done():
case dkgErrChan <- err:
Expand Down

0 comments on commit 6852b93

Please sign in to comment.