1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Fix commonspace tests

This commit is contained in:
mcrakhman 2025-02-05 13:09:32 +01:00
parent daefdae641
commit 4de44b020a
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
6 changed files with 357 additions and 343 deletions

View file

@ -355,6 +355,7 @@ type testTreeManager struct {
accService accountService.Service
deletedIds []string
markedIds []string
condFunc func()
treesToPut map[string]treestorage.TreeStorageCreatePayload
wait bool
waitLoad chan struct{}
@ -376,6 +377,9 @@ func (t *testTreeManager) MarkTreeDeleted(ctx context.Context, spaceId, treeId s
t.mx.Lock()
defer t.mx.Unlock()
t.markedIds = append(t.markedIds, treeId)
if t.condFunc != nil {
t.condFunc()
}
return nil
}
@ -470,6 +474,9 @@ func (t *testTreeManager) DeleteTree(ctx context.Context, spaceId, treeId string
}
t.deletedIds = append(t.deletedIds, treeId)
_, err = t.cache.Remove(ctx, treeId)
if t.condFunc != nil {
t.condFunc()
}
return nil
}