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

Snapshot tests crashes on CircleCI using Xcode 14.2 #707

Open
gutiago opened this issue Feb 10, 2023 · 6 comments
Open

Snapshot tests crashes on CircleCI using Xcode 14.2 #707

gutiago opened this issue Feb 10, 2023 · 6 comments

Comments

@gutiago
Copy link

gutiago commented Feb 10, 2023

Hello team, I am updating the Xcode image on Circle CI for my app, to use Xcode 14.2.
So far, with Xcode 14.0.1 and 14.1, the snapshot tests worked on the cloud.

But I noticed in the Xcode image of Circle CI for 14.2, the snapshot tests are only crashing. The log is showing me this current line in the code.

From initial debugging, it seems the saved image data is not being able to be converted to UIImage.
I'd like to understand with you if you can think of possible scenarios where this could happen. I'm running a little of out ideas about it.

Locally it works fine, but the CI image is somehow causing this effect. I don't know if could be permission related or something else, to make the image not able to be saved and generated later.

Crash log:

Exception Type:  EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: SIGNAL 4 Illegal instruction: 4
Terminating Process: exc handler [11701]
Triggered by Thread:  0

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libswiftCore.dylib                  0x7ff80d789a78 closure #1 in closure #1 in closure #1 in _assertionFailure(_:_:file:line:flags:) + 456
1   libswiftCore.dylib                  0x7ff80d78978b closure #1 in closure #1 in _assertionFailure(_:_:file:line:flags:) + 267
2   libswiftCore.dylib                  0x7ff80d78957d closure #1 in _assertionFailure(_:_:file:line:flags:) + 333
3   libswiftCore.dylib                  0x7ff80d7890f5 _assertionFailure(_:_:file:line:flags:) + 309
4   SnapshotTests                  		0x131cfff80 closure #2 in static Diffing<A>.image(precision:perceptualPrecision:scale:) + 256 (UIImage.swift:26)
5   SnapshotTests                  0x131c9380c verifySnapshot<A, B>(matching:as:named:record:snapshotDirectory:timeout:file:testName:line:) + 6540 (AssertSnapshot.swift:266)
6   SnapshotTests                  0x131c91d16 assertSnapshot<A, B>(matching:as:named:record:timeout:file:testName:line:) + 582 (AssertSnapshot.swift:41)
7   SnapshotTests                  0x131c77c6e closure #1 in XCTestCase.verify(_:on:perceptualPrecision:record:file:testName:line:) + 1214 (XCTestCase+Verify.swift:40)
8   SnapshotTests                  0x131c780a6 partial apply for closure #1 in XCTestCase.verify(_:on:perceptualPrecision:record:file:testName:line:) + 70
9   SnapshotTests                  0x131c7853c thunk for @callee_guaranteed () -> () + 12
10  SnapshotTests                  0x131c785a1 thunk for @escaping @callee_guaranteed () -> () + 17
11  UIKitCore                              0x1249119ef +[UIView(Animation) performWithoutAnimation:] + 84
12  SnapshotTests                  0x131c7704a XCTestCase.verify(_:on:perceptualPrecision:record:file:testName:line:) + 906 (XCTestCase+Verify.swift:38)
13  SnapshotTests                  0x131c73e24 XCTestCase.verify(_:on:perceptualPrecision:file:testName:line:) + 292 (XCTestCase+Recording.swift:51)

Any kind of insight would be really appreciated!
Thank you!

@mfiebig
Copy link

mfiebig commented Mar 6, 2023

It looks like we got the same issue in our project, but we think it is tied to macOS Version rather than Xcode Version. We use our own CI Agents with Xcode 14.0 and just upgrade them to Ventura (13.2.1).

@adamgrzegorowski-paramount

I got the same.

@mfiebig @gutiago Did you find some workaround?

@mfiebig
Copy link

mfiebig commented Jul 17, 2023

For us an unstable build environment was the root cause. The Swift toolchain crashed because the OS had some inconsistencies.

@adozenlines
Copy link

This is a known architectural issue if your local is Apple Silicon (arm64) and the CI runner is intel or vice versa.

@michaelversus
Copy link

michaelversus commented Jul 17, 2024

Hello all. We are having the same crashes @ bitrise Xcode 15.2 with an M1 runner. Has anyone figured out what causes those crashes maybe?

@adamgrzegorowski-paramount

My problem was git LFS. I have configured on local machine, but I missed this on Github Actions.

- name: Checkout
   uses: actions/checkout@v4
   with:
       lfs: true // HERE!

Docs: https://github.com/actions/checkout

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

5 participants