how to create a python-based keyword with a timeout?

117 views
Skip to first unread message

Bryan Oakley

unread,
Dec 15, 2015, 10:43:07 AM12/15/15
to robotframework-devel
Is there a supported way of creating a python based keyword that has a timeout, or do I have to manage that myself with a thread?


Mikko Korpela

unread,
Dec 15, 2015, 2:49:34 PM12/15/15
to Bryan Oakley, robotframework-devel
Oh those days... I really loved implementing this way back:
https://github.com/robotframework/robotframework/tree/master/src/robot/running/timeouts

Anyway hope that helps you Bryan! There are significant performance
implications if you do this in certain way and also GIL can make your
code not stop at all..

2015-12-15 17:43 GMT+02:00 Bryan Oakley <bryan....@gmail.com>:
> Is there a supported way of creating a python based keyword that has a
> timeout, or do I have to manage that myself with a thread?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "robotframework-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to robotframework-d...@googlegroups.com.
> To post to this group, send email to robotframe...@googlegroups.com.
> Visit this group at https://groups.google.com/group/robotframework-devel.
> For more options, visit https://groups.google.com/d/optout.



--
Mikko Korpela

Bryan Oakley

unread,
Dec 15, 2015, 3:52:35 PM12/15/15
to Mikko Korpela, robotframework-devel
So does that mean that robot.running.timeouts.KeywordTimeout is genuinely a public class I can use and will likely be supported for the foreseeable future?

Mikko Korpela

unread,
Dec 16, 2015, 11:10:13 PM12/16/15
to Bryan Oakley, robotframework-devel
Hi Bryan,

Sorry for not fully answering your original question.

[..] does that mean that robot.running.timeouts.KeywordTimeout is genuinely a public class I can use and will likely be supported for the foreseeable future?

Nope. I don't think so.

What I mean is that 

"
There are significant performance
implications if you do this in certain way and also GIL can make your
code not stop at all..
"

If you are going to

"
manage that [..] with a thread
"

Thanks,
-- 
Mikko Korpela

Pekka Klärck

unread,
Jan 25, 2016, 4:20:03 PM1/25/16
to Bryan Oakley, robotframework-devel
[Browsing through old emails I haven't had time to answer earlier...]

2015-12-15 17:43 GMT+02:00 Bryan Oakley <bryan....@gmail.com>:
> Is there a supported way of creating a python based keyword that has a
> timeout, or do I have to manage that myself with a thread?

No, there's no built-in way in Robot to do this. Now that library
keywords can have a custom name and tags using `robot_name` and
`robot_tags` attributes, adding support for `robot_timeout` would be
fine.

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org
Reply all
Reply to author
Forward
0 new messages