Skip to content

Commit d0eb863

Browse files
committed
Fixing a flaky test checking for async actions
1 parent 5402199 commit d0eb863

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/moov/connections_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package moov_test
22

33
import (
44
"testing"
5+
"time"
56

67
"github.com/moovfinancial/moov-go/pkg/moov"
78
"github.com/moovfinancial/moov-go/pkg/mv2507"
@@ -28,7 +29,14 @@ func Test_ShareConnection(t *testing.T) {
2829
})
2930

3031
t.Run("list accounts connected to merchant from the partner perspective", func(t *testing.T) {
31-
connections, err := mv2507.Accounts.ListConnected(BgCtx(), *mc, merchant.AccountID)
32+
var connections []mv2507.Account
33+
var err error
34+
35+
require.Eventually(t, func() bool {
36+
connections, err = mv2507.Accounts.ListConnected(BgCtx(), *mc, merchant.AccountID)
37+
return err == nil && len(connections) > 0
38+
}, time.Second*1, time.Millisecond*100)
39+
3240
require.NoError(t, err)
3341
require.NotNil(t, connections)
3442
require.Len(t, connections, 1)

0 commit comments

Comments
 (0)