Skip to content
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

Another case sensitivity issue (symlink and rename involved, of course - MacOS only) #322

Closed
agroce opened this issue Oct 26, 2017 · 4 comments
Labels

Comments

@agroce
Copy link

agroce commented Oct 26, 2017

import pyfakefs.fake_filesystem
import os

if os.path.exists('/Volumes/ramdisk/test'):
shutil.rmtree('/Volumes/ramdisk/test')
os.mkdir('/Volumes/ramdisk/test')

fs = pyfakefs.fake_filesystem.FakeFilesystem()
fs.CreateDirectory('/Volumes')
fs.CreateDirectory('/Volumes/ramdisk')
fs.CreateDirectory('/Volumes/ramdisk/test')
os0 = pyfakefs.fake_filesystem.FakeOsModule(fs)

component0 = "beta"
component1 = "b"
path0 = "/Volumes/ramdisk/test"
path0 += "/" + component0
component0 = "Beta"
path1 = "/Volumes/ramdisk/test"
path2 = "/Volumes/ramdisk/test"
os0.mkdir(path0)
path0 = "/Volumes/ramdisk/test"
path0 += "/" + component1
os0.symlink(path1,path0)
path0 += "/" + component0
path1 += "/" + component0
os0.rename(path0,path1)
result = sorted(os0.listdir(path2))

print result

pyfakefs: ['Beta', 'b']
os: ['b', 'beta']

Thought we were done, this one took some actual CPU time to generate. Testing at depth 100 didn't find anything, 200 took nearly 5 minutes to hit this, which is really a while.

@mrbean-bremen
Copy link
Member

Yes, I'm not surprised. As I said, I have no idea what the rules are under MacOS (as opposed to Windows, where it seems straightforward to me). So I'm running pure TDD here - just ensuring that the test passes and waiting for the next failing test...

@agroce
Copy link
Author

agroce commented Oct 27, 2017

I'm not surprised in the process, but TSTL taking that long running without coverage is always a bit of a shock. We basically ran this "TDD" process the same way for the JPL file systems, just closing the loop slightly quicker since the deadlines were much closer and it was everyone's day job (and IMO the file systems were a lot simpler, in some ways).

@agroce
Copy link
Author

agroce commented Oct 27, 2017

I suspect once I dig into more mutants, we'll have several more bursts of things uncovered like this.

@mrbean-bremen
Copy link
Member

Yes, I thought about checking the mutants myself, but didn't get to it. I wanted to fix the bugs I found in the pyfakefs tests vs. real FS first (issue #303) - which are mostly problems under Windows - but this has been stalled because of a Windows problem I'm having on my notebook after the latest Windows 10 update. Actually not the first problem - it just got worse after the last update. Sigh...
Until I resolve that, I will work under Linux, which is ok, but not good to find the Windows specific stuff, and also the stuff specific for case-insensitive fs. Maybe I will setup AppVeyor on GitHub to be able to run the Windows tests automatically.
Anyway, I have also tried to fix the current issue and got stuck because I really don't understand the logic behind. I don't have much free time at the moment, so this may take a while... Maybe with the next mutants you check there will come up some easy-to-fix issues that I can tackle meanwhile.

@mrbean-bremen mrbean-bremen changed the title Another case sensitivity issue (symlink and rename involved, of course) Another case sensitivity issue (symlink and rename involved, of course - MacOS only) Jan 13, 2018
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jan 21, 2018
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jan 21, 2018
mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jan 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants