-
Notifications
You must be signed in to change notification settings - Fork 28
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
Wait For will error if timeout is too small #60
Comments
Hi @damies13 , Yes, your analysis is correct, however the default timeout is 10 seconds (as set in the method definition). This means for timeout to be zero, user needs to explicitly set it so and in the sense, we don't consider the behavior incorrect. |
I understand and agree it's not a major issue, the only reason I raised it is because it would make implementing feature suggestion #61 a lot easier. |
Ok, now I wrapped my head around the bigger point behind these two issues :) Your comment really illuminated the situation I think your plan is solid: make so that one can pass I have a note about #61, but I'll comment there about that I'm currently bit busy for at least a month so contributions if you have time are more than welcome :) Reviewing & releasing I can do in timely manner. |
@Tattoo In this line is there a reason for forcing
FYI - I have seen application performance SLA's that require for certain functions the application responds within 1/2 second (500ms) or 300ms, so I'm thinking to remove the int() and allow decimal values. The alternative is we should place int around time() on this line and 247.
|
Fix for issue eficode#60 This fix ensures even if timeout is set to 0 (zero) locate is called at least once.
Keywords that now have the optional timeout are: - Click Image - Click To The Above Of Image - Click To The Below Of Image - Click To The Left Of Image - Click To The Right Of Image - Copy From The Above Of - Copy From The Below Of - Copy From The Left Of - Copy From The Right Of The default timeout is 0 sec so there is no functional change from previous version unless a timeout is set, this does require Pull request eficode#64 (fix for issue eficode#60) as a prerequisite for this change in order to work as expected. Please only merge after Pull request eficode#64
commit 9db931a Author: Dave Amies <damies13@gmail.com> Date: Sun Feb 27 10:02:46 2022 +1000 Fix for issue eficode#60 Fix for issue eficode#60 This fix ensures even if timeout is set to 0 (zero) locate is called at least once.
commit d95e646 Author: Dave Amies <damies13@gmail.com> Date: Sun Feb 27 13:23:14 2022 +1000 Add timeout option to keywords - Issue eficode#61 Keywords that now have the optional timeout are: - Click Image - Click To The Above Of Image - Click To The Below Of Image - Click To The Left Of Image - Click To The Right Of Image - Copy From The Above Of - Copy From The Below Of - Copy From The Left Of - Copy From The Right Of The default timeout is 0 sec so there is no functional change from previous version unless a timeout is set, this does require Pull request eficode#64 (fix for issue eficode#60) as a prerequisite for this change in order to work as expected. Please only merge after Pull request eficode#64
I was looking at the code for the wait_for function and I believe that if the timeout is too small this function will always error.
If the timeout is 0 then the while loop will not be entered and self._locate will never be called, therefore location will remain none and ImageNotFoundException will be called, i'm not sure how big timeout would have to be to prevent this happening and I suspect a small timeout of 0.01 would be enough to allow the while loop to be entered at least once.
https://github.com/eficode/robotframework-imagehorizonlibrary/blob/master/src/ImageHorizonLibrary/recognition/_recognize_images.py#L247
The text was updated successfully, but these errors were encountered: