-
Notifications
You must be signed in to change notification settings - Fork 515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MemMapFS: missing files after write multi files in concurrency #361
Labels
Comments
Closed
Ping @bep Please check this issue. For quick reproduce: https://go.dev/play/p/3xkOSEBVoNS |
Your failing test case looks correct to me (as in, it should not fail), which comes a little as a surprise to mek as I use this pretty concurrently myself ... It's not obvious to me why, though. I also agree about the Mkdir bug, assuming that that's how most sane real file systems work? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have used
afero.MemMapFs
for filesystem mock test in my projects.But I got some unexpected test results.
I want to list all files in target directory that I have wrote multi files in concurrency before.
Occasionally some files are not returned by
Readdir
function. Also I had the same problem callingWalk
function on this directory.Here is a test to reproduce my problem. https://github.com/sko00o/afero-test/blob/main/memmap/memmap_test.go#L42
failure result:
I notice another issue #298 that found
MemMapFs.Mkdir
have problem when call in concurrency.In my opinion, we need a double check here before we create new directory.
So I send a PR for this.
The text was updated successfully, but these errors were encountered: