fix deals test
This commit is contained in:
parent
3c37078a85
commit
189f5f8aae
@ -150,6 +150,7 @@ func TestDealRetrieveByAnyCid(t *testing.T) {
|
|||||||
Selector: shared.AllSelector(),
|
Selector: shared.AllSelector(),
|
||||||
}},
|
}},
|
||||||
).Write(tmp)
|
).Write(tmp)
|
||||||
|
require.NoError(t, err)
|
||||||
require.NoError(t, tmp.Close())
|
require.NoError(t, tmp.Close())
|
||||||
require.NoError(t, rd.Close())
|
require.NoError(t, rd.Close())
|
||||||
|
|
||||||
|
@ -377,6 +377,7 @@ type RunConcurrentDealsOpts struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (dh *DealHarness) RunConcurrentDeals(opts RunConcurrentDealsOpts) {
|
func (dh *DealHarness) RunConcurrentDeals(opts RunConcurrentDealsOpts) {
|
||||||
|
ctx := context.Background()
|
||||||
errgrp, _ := errgroup.WithContext(context.Background())
|
errgrp, _ := errgroup.WithContext(context.Background())
|
||||||
for i := 0; i < opts.N; i++ {
|
for i := 0; i < opts.N; i++ {
|
||||||
i := i
|
i := i
|
||||||
@ -402,7 +403,18 @@ func (dh *DealHarness) RunConcurrentDeals(opts RunConcurrentDealsOpts) {
|
|||||||
dh.t.Logf("retrieving deal %d/%d", i, opts.N)
|
dh.t.Logf("retrieving deal %d/%d", i, opts.N)
|
||||||
|
|
||||||
outPath := dh.PerformRetrieval(context.Background(), deal, res.Root, opts.CarExport)
|
outPath := dh.PerformRetrieval(context.Background(), deal, res.Root, opts.CarExport)
|
||||||
AssertFilesEqual(dh.t, inPath, outPath)
|
|
||||||
|
if opts.CarExport {
|
||||||
|
f, err := os.Open(outPath)
|
||||||
|
require.NoError(dh.t, err)
|
||||||
|
actualFile := dh.ExtractFileFromCAR(ctx, f)
|
||||||
|
require.NoError(dh.t, f.Close())
|
||||||
|
|
||||||
|
AssertFilesEqual(dh.t, inPath, actualFile.Name())
|
||||||
|
} else {
|
||||||
|
AssertFilesEqual(dh.t, inPath, outPath)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user