-
Notifications
You must be signed in to change notification settings - Fork 435
fix: make runUntilDate not system aware #1050
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
base: master
Are you sure you want to change the base?
fix: make runUntilDate not system aware #1050
Conversation
related to #1045 |
Could you please describe the purpose of this PR and the problem it solves? |
…om/codeskyblue/WebDriverAgent into fix_stuck_when_system_time_changes
#import <Foundation/Foundation.h> | ||
|
||
@interface NSRunLoop (Monotonic) | ||
- (void)runForMonotonicInterval:(NSTimeInterval)seconds; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a docstring to the public interface method?
- (void)runForMonotonicInterval:(NSTimeInterval)seconds { | ||
CFTimeInterval end = CACurrentMediaTime() + seconds; | ||
while (CACurrentMediaTime() < end) { | ||
[self runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can your issue be resolved with:
[self runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; | |
[self runMode:NSRunLoopCommonModes beforeDate:[NSDate distantFuture]]; |
It looks like the default mode could block some actions such as UI tracking. I observed this blocking behavior in testGetPasteboard
's fb_typeText
method for example. It caused many timeouts in tests (e.g. https://dev.azure.com/AppiumCI/Appium%20CI/_build/results?buildId=30265&view=results).
https://stackoverflow.com/questions/7222449/nsdefaultrunloopmode-vs-nsrunloopcommonmodes
No description provided.