-
Notifications
You must be signed in to change notification settings - Fork 578
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
Padding difference between snapshots taken one after the other with no changes #736
Comments
we have similar situation when run on new Xcode 15 beta |
Seeing this too. It randomly inserts an offset at the top, maybe 25% of the time. Same machine, same iOS version. Xcode 14.3 and iOS 16.4. |
Is there any solution for it? Its still present in Xcode 15.0.1 and iOS 17.0.1 |
ping @stephencelis @mbrandonw |
For me there is a difference if I run all Tests of a XCTestCase or one after another. |
My colleagues and I are all using M1 / M2 machines. We are all having the same development environment meaning Xcode Version, OS version and Simulator model and its OS version. Xcode 15.0.1 Colleague A - records snapshots on their machine (using erased and fresh simulator) and commits them to repo. In CI - situation is the same, tests are failing because of padding issue. Each time, simulator device state is fresh(erased device). We tested it on multiple computers and nothing seems to fix the issue. Our temporary fix is done by lowering the precision by 14%(!) |
This seems to be fixed in the latest Xcode RC - 15.1 |
@Zeynal7 unfortunately it's not fixed for us :( |
Thanks @nandodelauni , it worked with me after i changed Language & Region settings in simulator after macOS |
I've found the root cause of this issue, at least in the tests I'm running! In iOS 17, Apple made a change to labels and text fields that use Dynamic Type text styles. These labels will now adjust their line height based on the full list of languages configured in the device In my own testing, I've found that having Arabic, Thai, or Kurdish anywhere in your list of languages will cause additional line height on labels. There are likely other languages that trigger the additional height; these are just the ones I've found in my testing. I've also found that new iOS simulators created in Xcode inherit the list of languages configured in the macOS So if your test snapshots were generated on a device that had a different set of languages configured than the ones configured on your test device, you may see these test failures. It may be useful to specify that tests should be run on a device configured with only a specific list of languages. |
I am currently struggling with some snapshots and I do not understand the reasoning for it. This has happened to a lesser extent before but someone else from the team generated the snapshot with a M1 and it passed on the pipeline so that did the job at the time.
The problem is, right now, regardless if the snapshot is generated in a M2 (my machine) or M1, it does not work. In fact, right after taking a snapshot, even though there was no code change, the snapshot does not match. The only difference between both is that one image has a top padding compared to the other.
Why is this happening when nothing is being changed between tests and the environment is the same?
The text was updated successfully, but these errors were encountered: