diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi index b1a66cfd1..ce7083b3d 160000 --- a/extern/filecoin-ffi +++ b/extern/filecoin-ffi @@ -1 +1 @@ -Subproject commit b1a66cfd12686a8af6030fccace49916849b1954 +Subproject commit ce7083b3d187ec3bc41a68ab66567bd4f3be6dfc diff --git a/extern/sector-storage/ffiwrapper/sealer_cgo.go b/extern/sector-storage/ffiwrapper/sealer_cgo.go index f2d09c90a..6a6e3f56c 100644 --- a/extern/sector-storage/ffiwrapper/sealer_cgo.go +++ b/extern/sector-storage/ffiwrapper/sealer_cgo.go @@ -685,9 +685,9 @@ func (sb *Sealer) ReplicaUpdate(ctx context.Context, sector storage.SectorRef, p } // XXX: we want to keep the stuff at the end - // if err := os.Truncate(paths.Unsealed, sealedSize); err != nil { - // return empty, xerrors.Errorf("failed to truncate unsealed data file: %w", err) - // } + if err := os.Truncate(paths.Unsealed, sealedSize); err != nil { + return empty, xerrors.Errorf("failed to truncate unsealed data file: %w", err) + } sealed, unsealed, err := ffi.SectorUpdate.EncodeInto(updateProofType, paths.Update, paths.UpdateCache, paths.Sealed, paths.Cache, paths.Unsealed, pieces) if err != nil { diff --git a/extern/sector-storage/manager_test.go b/extern/sector-storage/manager_test.go index 59db66bac..6e71430b5 100644 --- a/extern/sector-storage/manager_test.go +++ b/extern/sector-storage/manager_test.go @@ -68,11 +68,16 @@ func newTestStorage(t *testing.T) *testStorage { } func (t testStorage) cleanup() { - // for _, path := range t.StoragePaths { - // if err := os.RemoveAll(path.Path); err != nil { - // fmt.Println("Cleanup error:", err) - // } - // } + noCleanup := os.Getenv("LOTUS_TEST_NO_CLEANUP") != "" + for _, path := range t.StoragePaths { + if noCleanup { + fmt.Printf("Not cleaning up test storage at %s\n", path) + continue + } + if err := os.RemoveAll(path.Path); err != nil { + fmt.Println("Cleanup error:", err) + } + } } func (t testStorage) GetStorage() (stores.StorageConfig, error) {