GODT-1482: Comment or mitigate panics, unlock cache when needed.

This commit is contained in:
Jakub
2021-12-21 11:34:21 +01:00
committed by Jakub Cuth
parent e9c05c5a6b
commit df601ecbbd
15 changed files with 312 additions and 51 deletions

View File

@ -187,7 +187,8 @@ func (mocks *mocksForStore) newStoreNoEvents(t *testing.T, combinedMode bool, ms
mocks.user.EXPECT().GetClient().AnyTimes().Return(mocks.client)
mocks.client.EXPECT().GetUserKeyRing().Return(tests.MakeKeyRing(t), nil).AnyTimes()
testUserKeyring := tests.MakeKeyRing(t)
mocks.client.EXPECT().GetUserKeyRing().Return(testUserKeyring, nil).AnyTimes()
mocks.client.EXPECT().Addresses().Return(pmapi.AddressList{
{ID: addrID1, Email: addr1, Type: pmapi.OriginalAddress, Receive: true},
{ID: addrID2, Email: addr2, Type: pmapi.AliasAddress, Receive: true},
@ -225,6 +226,8 @@ func (mocks *mocksForStore) newStoreNoEvents(t *testing.T, combinedMode bool, ms
)
require.NoError(mocks.tb, err)
require.NoError(mocks.tb, mocks.store.UnlockCache(testUserKeyring))
// We want to wait until first sync has finished.
// Checking that event after sync was reuested is not the best way to
// do the check, because sync could take more time, but sync is going