Issues with timeout param

8 views
Skip to first unread message

dvan...@gmail.com

unread,
Apr 21, 2011, 11:21:57 AM4/21/11
to UISpec
I am having issues utilizing the timeout mechanism for UIQuery. My
code is as follows for the query:

UIButton *buyButton = [[app timeout:1].button.imageView image:[UIImage
imageNamed:imageName]];

No matter what I try it always takes 10s(instead of 1s) as I'd like it
to. Ideally I actually want 0 timeout.. basically look for the item
once and if it isn't there then just give up and fail. Any help is
appreciated.

Pete Hodgson

unread,
Apr 21, 2011, 12:27:07 PM4/21/11
to uis...@googlegroups.com
We saw a similar issue ourselves. IIRC it turns out that that timeout is actually applied each time you traverse down the view hierarchy, or something like that. So if you have a 10 layer view heirarchy it will take 10 seconds to *not* find something. I may be a little off on the details, but I'm pretty sure that was the basic problem. 

I started working on a patch to resolve this, but never got 'round to finishing it off nicely. If you manage to find a solution I'd love to hear about it :)

Cheers,
Pete


--
You received this message because you are subscribed to the Google Groups "UISpec" group.
To post to this group, send email to uis...@googlegroups.com.
To unsubscribe from this group, send email to uispec+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/uispec?hl=en.


dvan...@gmail.com

unread,
Apr 21, 2011, 6:00:04 PM4/21/11
to UISpec
It looks like params like timeout don't make their way down into the
redoer.. so even though timeout might be set on the app(if you do
app.timeout = 1;) it doesn't get set in the redoer so there are two
time based loops that pay no attention to the timeout. I found this
using the debugger. I short circuited the loops to break after the
first iteration and I was able to fail a check in less than .5s.

Of course the way the loops are coded setting a low timeout could
cause it to never go into the loop(I think changing to a do while
instead of a while do would solve that race condition).

On Apr 21, 9:27 am, Pete Hodgson <phodg...@thoughtworks.com> wrote:
> We saw a similar issue ourselves. IIRC it turns out that that timeout is
> actually applied each time you traverse down the view hierarchy, or
> something like that. So if you have a 10 layer view heirarchy it will take
> 10 seconds to *not* find something. I may be a little off on the details,
> but I'm pretty sure that was the basic problem.
>
> I started working on a patch to resolve this, but never got 'round to
> finishing it off nicely. If you manage to find a solution I'd love to hear
> about it :)
>
> Cheers,
> Pete
>
Reply all
Reply to author
Forward
0 new messages