-
-
Notifications
You must be signed in to change notification settings - Fork 342
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
Fix dispatchIdleTimeout on Apple Silicon #2164
Comments
Is the logic also broken on iPhones, @kevinrenskers? |
Yes. Just create a new project in Xcode, Obj-C. Use this in the AppDelegate.
And yea...
|
Maybe it's not a real world problem, but the fact that the test in Swift returns a different expected |
@kevinrenskers, please try
Instead of getting the dispatch time in advance, pass the constant |
That doesn't help, as it's still the addition of |
I've sent a request for help to Apple Developer Technical Support. |
Got an answer from Apple.
I wasn't really sure what he meant so I asked for clarification and he sent this:
So basically I don't see a way of calling |
That makes sense, @kevinrenskers. Thanks for the update. I'm going to restructure the code a bit and open a PR soon. |
The testIdleTimeout_InvokesDispatchAfterWithCorrectWhen always failed on M1 Macs. This was because we used a different way of calculating the expected dispatch_time in the tests than in the ObjC code. The failing tests purpose is to validate that the proper timeout is used to schedule the cancel block. This PR restructures the code so the SentryDispatchQueueWrapper hides this complexity, and callers don't need to calculate the dispatch_time themselves. Now the test validates that the proper timeout is passed down to SentryDispatchQueueWrapper. Fixes GH-2164
The testIdleTimeout_InvokesDispatchAfterWithCorrectWhen always failed on M1 Macs. This was because we used a different way of calculating the expected dispatch_time in the tests than in the ObjC code. The failing tests purpose is to validate that the proper timeout is used to schedule the cancel block. This PR restructures the code so the SentryDispatchQueueWrapper hides this complexity, and callers don't need to calculate the dispatch_time themselves. Now the test validates that the proper timeout is passed down to SentryDispatchQueueWrapper. Fixes GH-2164
Description
The
testIdleTimeout_InvokesDispatchAfterWithCorrectWhen
test always fails when running on M1 Macs, and that's not because the test is flaky, it's because the underlying logic in thedispatchIdleTimeout
method is broken on Apple Silicon.See also https://stackoverflow.com/questions/73703816/dispatch-time-calculations-are-failing-on-apple-silicon, where sadly no answers have been posted yet.
Test doesn't fail on CI or Philip's machine, because they run on Intel.
The text was updated successfully, but these errors were encountered: