Skip to content

Commit

Permalink
fix flaky TestMultipleDealsConcurrent (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc authored Oct 5, 2022
1 parent 1835120 commit 624e14d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions storagemarket/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1949,20 +1949,24 @@ func (td *testDeal) executeAndSubscribeImportOfflineDeal() error {
}

func (td *testDeal) executeAndSubscribe() error {
pi, err := td.ph.Provider.ExecuteDeal(context.Background(), td.params, "")
dh, err := td.ph.Provider.mkAndInsertDealHandler(td.params.DealUUID)
if err != nil {
return err
}
if !pi.Accepted {
return fmt.Errorf("deal not accepted: %s", pi.Reason)
}
dh := td.ph.Provider.getDealHandler(td.params.DealUUID)
sub, err := dh.subscribeUpdates()
if err != nil {
return err
}
td.sub = sub

pi, err := td.ph.Provider.ExecuteDeal(context.Background(), td.params, "")
if err != nil {
return err
}
if !pi.Accepted {
return fmt.Errorf("deal not accepted: %s", pi.Reason)
}

return nil
}

Expand Down

0 comments on commit 624e14d

Please sign in to comment.