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

failed - Snapshot comparison failed: Optional(Error Domain=Foundation._GenericObjCError Code=0 "(null)") #124

Open
brunosrocha opened this issue Mar 30, 2020 · 8 comments

Comments

@brunosrocha
Copy link

Does someone have the same issue?

No matter what I do I keep getting this failed - Snapshot comparison failed: Optional(Error Domain=Foundation._GenericObjCError Code=0 "(null)") when trying to run my snapshot tests.

I am using XCode 11.3.1

@MichaelKearnsSoftwire
Copy link

We're also having this issue -- interestingly it's only affecting some of us, despite having near-identical setups.

@brunodossantosrocha1510 have you managed to find any workarounds since you posted this?

@brunosrocha
Copy link
Author

@MichaelKearnsSoftwire I have tried literally everything and also didn't have success.. Have you had any success?

@anaccborba
Copy link

I'm having exactly the same problem with version 11.3.1 of XCode

@MichaelKearnsSoftwire
Copy link

Have you had any success?

@brunodossantosrocha1510 yes, we have in fact! It seemed to be a permissions issue.

Things you could try which might solve the problem:

  1. Try running as a different user (either as admin or non-admin)
  2. Delete the snapshot files, re-generate them then re-execute the tests.

In our investigation, we saw that executing against the freshly checked-out repository caused the above error, but deleting and re-generating the snapshot images enabled them to pass -- the re-generated images had the same binary content (so git did not show any differences) but inspecting the files with ls -al@ showed that the extended attributes of the file had changed, adding a new com.apple.macl attribute (more info on this here)

Afraid I don't have any more info right now -- hopefully the above helps you out, if not I'll see if I can find out more next week.

@cgi-isaac
Copy link

I think I was seeing these errors and was able to solve them by giving SimulatorTrampoline.xpc full disk access. I'm not sure that's ideal, though.

@Unihilator
Copy link

Same here, XCode 11.6. Tried to give full access to SimulatorTrampoline without success

@watanavex
Copy link

@brunodossantosrocha1510

I had the same problem. And that was resolved.

I was NOT calling the super.setUp().
hope this helps.

@davifmarcelino
Copy link

I have this problem and it was happening because the Desktop folder locked the files and the snapshot can not read them, so now I just use the root folder (~/) and everything worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants