Skip to content

Commit

Permalink
Fix mem tests (#123)
Browse files Browse the repository at this point in the history
* fixes #90 - remove filesystem file map entry on delete.  unlock mutex only in coxtext of mem to memmoves.

* updated CHANGELOG.md
  • Loading branch information
funkyshu authored Jul 8, 2022
1 parent d8b1256 commit ffc7f4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Fixed golangci-lint issues
- Fixed #90 - integration were tests failing on move for mem-to-mem move and bad mutex unlock call when doing mem to non-mem move

## [6.4.0]

Expand Down
4 changes: 2 additions & 2 deletions backend/mem/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ func (f *File) MoveToLocation(location vfs.Location) (vfs.File, error) {
return file, nil
}
}
f.memFile.location.FileSystem().(*FileSystem).mu.Unlock()
}
f.memFile.location.FileSystem().(*FileSystem).mu.Unlock()
// if the file doesn't yet exist at the location, create it there
newFile, err := location.NewFile(f.Name())
if err != nil {
Expand Down Expand Up @@ -447,7 +447,7 @@ func (f *File) Delete(_ ...options.DeleteOption) error {
thisObj.i = nil
thisObj = nil
// setting that key to nil so it truly no longer lives on this system
mapRef[loc.Volume()][str] = nil
delete(mapRef[loc.Volume()], str)
}
}

Expand Down

0 comments on commit ffc7f4f

Please sign in to comment.