From 184f0cc1e33b4c7c50b85a60b918a98f4365de47 Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Thu, 13 Jun 2024 09:56:37 -0700 Subject: [PATCH] test db merge sequential --- internal/db/merge.go | 22 ++++++++++------------ internal/db/subscriptions.go | 1 - tests/integration/utils2.go | 5 ----- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/internal/db/merge.go b/internal/db/merge.go index fcc311eadc..6cb264e6b3 100644 --- a/internal/db/merge.go +++ b/internal/db/merge.go @@ -46,18 +46,16 @@ func (db *db) handleMerges(ctx context.Context, sub *event.Subscription) { if !ok { continue } - go func() { - err := db.executeMerge(ctx, merge) - if err != nil { - log.ErrorContextE( - ctx, - "Failed to execute merge", - err, - corelog.String("CID", merge.Cid.String()), - corelog.String("Error", err.Error()), - ) - } - }() + err := db.executeMerge(ctx, merge) + if err != nil { + log.ErrorContextE( + ctx, + "Failed to execute merge", + err, + corelog.String("CID", merge.Cid.String()), + corelog.String("Error", err.Error()), + ) + } } } } diff --git a/internal/db/subscriptions.go b/internal/db/subscriptions.go index b469ac9c6e..491ae44468 100644 --- a/internal/db/subscriptions.go +++ b/internal/db/subscriptions.go @@ -31,7 +31,6 @@ func (db *db) handleSubscription(ctx context.Context, r *request.Request) (<-cha if !ok { return nil, client.NewErrUnexpectedType[request.ObjectSubscription]("SubscriptionSelection", selections) } - // subscribe to the subscription event bus so we don't block the system bus sub, err := db.events.Subscribe(event.UpdateName) if err != nil { return nil, err diff --git a/tests/integration/utils2.go b/tests/integration/utils2.go index 559d9d7816..80bc4920d8 100644 --- a/tests/integration/utils2.go +++ b/tests/integration/utils2.go @@ -657,11 +657,6 @@ func setStartingNodes( s.nodes = append(s.nodes, c) s.dbPaths = append(s.dbPaths, path) - - // subscribe to merge complete events - sub, err := c.Events().Subscribe(event.MergeCompleteName) - require.NoError(s.t, err) - s.eventSubs = append(s.eventSubs, sub) } }