mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
Other: Fix goroutine leaks in sync tests
Add missing Close calls. Properly handle nil channel for `user.startSync`. This patch also updated liteapi and Gluon to latest master and dev version respectively.
This commit is contained in:
committed by
James Houlahan
parent
6fdc8bd379
commit
6bbaf03f1f
@ -25,6 +25,8 @@ import (
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"go.uber.org/goleak"
|
||||
|
||||
"github.com/ProtonMail/proton-bridge/v2/internal/bridge"
|
||||
"github.com/ProtonMail/proton-bridge/v2/internal/events"
|
||||
"github.com/bradenaw/juniper/iterator"
|
||||
@ -36,6 +38,8 @@ import (
|
||||
)
|
||||
|
||||
func TestBridge_Sync(t *testing.T) {
|
||||
defer goleak.VerifyNone(t, goleak.IgnoreCurrent())
|
||||
|
||||
s := server.New()
|
||||
defer s.Close()
|
||||
|
||||
@ -56,6 +60,7 @@ func TestBridge_Sync(t *testing.T) {
|
||||
liteapi.WithTransport(liteapi.InsecureTransport()),
|
||||
).NewClientWithLogin(ctx, "imap", password)
|
||||
require.NoError(t, err)
|
||||
defer c.Close()
|
||||
|
||||
user, err := c.GetUser(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user