Timeouts not functioning properly

Bug reports.
User avatar
Gunner1980
Posts: 89
Joined: Mon Apr 05, 2010 8:44 pm
Location: Austin, Texas

Timeouts not functioning properly

Post by Gunner1980 » Thu Apr 14, 2011 8:29 pm

Ok so I had the following code which worked just fine in 2.3.8.

Code: Select all

		if (repo.FormTacViewC2.PictureTrackCreateDropInfo.Exists())
			{
				TacViewLib.LinkSpecific.Surveillance.Drop_Track.DropTrack.Start();
			}
		
The search timeout on the repo item is set to 2 secons however the timeouts are getting set by the parent folder item in the repo instead of the item itself. I used to see this every once in a while in 2.3.8 but only with certain repository item types. Now I am seeing it on items that used to work just fine.

Even if I set the timeout in user code using the following function

Code: Select all

Duration OrigDur = repo.FormTacViewC2.PictureTrackCreateDropInfo.SearchTimeout;
repo.FormTacViewC2.PictureTrackCreateDropInfo.SearchTimeout = 2000;       
 
It ignores the user code and uses the parent folders timeout which in this case is FormTacViewC2. The only way for me to get the timeout to function properly is to move the PictureTrackCreateDrop repo item to the parent directory so it isn't under a folder and specify the timeout.

Please fix this.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Timeouts not functioning properly

Post by Support Team » Fri Apr 15, 2011 10:14 am

Gunner1980 wrote:The search timeout on the repo item is set to 2 secons however the timeouts are getting set by the parent folder item in the repo instead of the item itself.
Items in a repository are searched using the repository structure. I.e. Ranorex uses the timeout set for the folder to search the folder and then uses the timeout for the item to search the item relatively from its parent folder. That's exactly the same behavior as in 2.X.

The only difference with 3.X is that if all parents folders of an item have "Use Cache" set to false, Ranorex does not use the repository structure, but immediately searches the absolute path of the item using the "Effective Timeout" for that item, that is the sum of the item's timeout and the timeout of its parent folders.
Gunner1980 wrote:It ignores the user code and uses the parent folders timeout
It uses the set timeout to search relatively from the parent folder. However, the parent folder needs to be searched first (unless cached) with its timeout.

I'm curious, what is the use case of setting such a low timeout? Do you want Ranorex to stop searching after 2 seconds?

Regards,
Alex
Ranorex Team

User avatar
Gunner1980
Posts: 89
Joined: Mon Apr 05, 2010 8:44 pm
Location: Austin, Texas

Re: Timeouts not functioning properly

Post by Gunner1980 » Fri Apr 15, 2011 4:02 pm

Support Team wrote: The only difference with 3.X is that if all parents folders of an item have "Use Cache" set to false, Ranorex does not use the repository structure, but immediately searches the absolute path of the item using the "Effective Timeout" for that item, that is the sum of the item's timeout and the timeout of its parent folders.
Why was this change made? I had been told to set the cache to false in order to deal with some other problems we were having a while back. I don't remember exactly which thing it fixed. Are you telling me if I set the folder cache settings to true that the timeouts will be taken from the repo item itself rather than combining that timeout with the timeout of the parent folder/form?

Support Team wrote: I'm curious, what is the use case of setting such a low timeout? Do you want Ranorex to stop searching after 2 seconds?
Yes I do want it to quit searching for the item after 2 seconds. It will either be there immediately or it won't be there at all in my case. I don't want it to slow down the test by sitting there waiting 30 seconds every time this function gets called. I also don't want to set the parent items search timeout down as it is used for other items that won't necessarily be there immediately. My only solution has been to move it to the top.

I don't just use Ranorex for GUI testing I actually use it to enter data on one GUI and then transmit data over ethernet or serial connections to another system which I am also logged into with another GUI and I validate that the data was received and that it matches the data that was sent.

The case I need this for is when I delete an item I want to make sure it purged within a specific timeout across the wire. If it wasn't purged I want to log and error and attempt to purge it again. The problem is if it works properly which it almost always does I'm sitting there for whatever the parent items timeout is waiting to move onto the next step, in this case it is an error if it exists.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Timeouts not functioning properly

Post by Support Team » Mon Apr 18, 2011 10:44 am

Gunner1980 wrote:Why was this change made?
Because it made sense to have the option to always search using the absolute path. And if you do not use folder caching, the repository structure does not make much sense.
Gunner1980 wrote: Are you telling me if I set the folder cache settings to true that the timeouts will be taken from the repo item itself rather than combining that timeout with the timeout of the parent folder/form?
Right, if you set the "Use Cache" property of only one of the parent folders (e.g. the app folder) to true, the repository structure will be used for the search and, consequently, the individual timeouts for folders and items, not the combined timeout will be used.

Regards,
Alex
Ranorex Team