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:
Leander Beernaert
2022-10-21 13:58:18 +02:00
committed by James Houlahan
parent 6fdc8bd379
commit 6bbaf03f1f
10 changed files with 63 additions and 21 deletions

View File

@ -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)