fix: chain: Fix flaky TestChainExportImport

This commit is contained in:
Łukasz Magiera 2022-12-02 22:13:12 +01:00
parent 1791db57f6
commit cdf169ed83
2 changed files with 3 additions and 3 deletions

View File

@ -110,7 +110,7 @@ func TestChainExportImport(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
nbs := blockstore.NewMemory() nbs := blockstore.NewMemorySync()
cs := store.NewChainStore(nbs, nbs, datastore.NewMapDatastore(), filcns.Weight, nil) cs := store.NewChainStore(nbs, nbs, datastore.NewMapDatastore(), filcns.Weight, nil)
defer cs.Close() //nolint:errcheck defer cs.Close() //nolint:errcheck
@ -148,7 +148,7 @@ func TestChainExportImportFull(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
nbs := blockstore.NewMemory() nbs := blockstore.NewMemorySync()
cs := store.NewChainStore(nbs, nbs, datastore.NewMapDatastore(), filcns.Weight, nil) cs := store.NewChainStore(nbs, nbs, datastore.NewMapDatastore(), filcns.Weight, nil)
defer cs.Close() //nolint:errcheck defer cs.Close() //nolint:errcheck

View File

@ -51,7 +51,7 @@ var genesisVerifyCmd = &cli.Command{
if !cctx.Args().Present() { if !cctx.Args().Present() {
return fmt.Errorf("must pass genesis car file") return fmt.Errorf("must pass genesis car file")
} }
bs := blockstore.FromDatastore(datastore.NewMapDatastore()) bs := blockstore.NewMemory()
cs := store.NewChainStore(bs, bs, datastore.NewMapDatastore(), filcns.Weight, nil) cs := store.NewChainStore(bs, bs, datastore.NewMapDatastore(), filcns.Weight, nil)
defer cs.Close() //nolint:errcheck defer cs.Close() //nolint:errcheck