You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Executing run multiple times on RobotRunner fails #881
Originally submitted to Google Code by imranoftherings on 19 Jun 2011
To try to save the time of RobotRunner instance creation, I create RobotRunner once. The I reuse the same instance of the RobotRunner object to run test suites.
First time execution works fine in 2.6 alpha. Executing run a second time fails with
[ ERROR ] Unexpected error: AttributeError: RunnableTestSuite instance has no attribute 'remove_keywords'
Developers use RF for testing their changes locally. So we usually we have users who execute one test suite at a time. The cost of RobotRunner instance creation every time is prohibitive and infact much higher than the actual test execution time.
I'm surprised this worked with 2.5.7. Could you attach relevant code here so that we can test this on our environment?
Notice that we also had issue 826 about enhancing the running APIs so that this would work better targeted for 2.6. Unfortunately there's no time to do this rather large cleanup at this point.
Originally submitted to Google Code by imranoftherings on 20 Jun 2011
I am attaching a wrapper class which should effectively allow you to reproduce the issue. Maybe it was not intended to be a feature but it was working with 2.5.7 nonetheless
It wasn't working perfectly though. Modifying a resource file still needed a restart. I guess that is due to left over cache not being updated.
I am already tracking issue 826 . I can work with however it was running in 2.5.7 till we enhance RF to support this properly. Hopefully in 2.7
DISCLAIMER: These suggestions are in my opinion hacks.
Can you set report generation off in your test environment (--report NONE)?
As the remove_keywords method should be related to report generation. Hopefully there are no other errors..
One other thing that might make things work faster (I haven't tried this one though and don't know if RobotRunner even is Serializable) could be to serialize the whole RobotRunner instance (in memory and not to disc) before running it and deserialize a clone for every test re-run.
Originally submitted to Google Code by imranoftherings on 1 Aug 2011
Thanks Mikko. I will give these methods a try and see what works. What I am doing right now is a hack anyways, so I am not that concerned whether the suggestions are hacks or not : )
Originally submitted to Google Code by anthony.gilley on 5 Oct 2011
Mikko,
Attaching a sample file. The output is pasted below. It fails on the second run.
==============================================================================
Lamptest
==============================================================================
Connect to lamp | PASS |
------------------------------------------------------------------------------
Firmware version test | PASS |
------------------------------------------------------------------------------
Nr of devices test | PASS |
------------------------------------------------------------------------------
LED Driver FW test | PASS |
------------------------------------------------------------------------------
LED Plate Wavelength Test | PASS |
------------------------------------------------------------------------------
Temperature Test | PASS |
------------------------------------------------------------------------------
RTC test | PASS |
------------------------------------------------------------------------------
Simple LED test | PASS |
------------------------------------------------------------------------------
Device voltage test | PASS |
------------------------------------------------------------------------------
Stress loop test | PASS |
------------------------------------------------------------------------------
Close | PASS |
------------------------------------------------------------------------------
Lamptest | PASS |
11 critical tests, 11 passed, 0 failed
11 tests total, 11 passed, 0 failed
==============================================================================
Output: C:\Anthony\robottest\output.xml
Log: C:\Anthony\robottest\log.html
[ ERROR ] Unexpected error: AttributeError: RunnableTestSuite instance has no attribute 'remove_keywords'
Traceback (most recent call last):
File "C:\Users\anthony\Documents\NetBeansProjects\EOLTest\lib\robotframework-2.6.2.jar\Lib\robot\__init__$py.class", line 88, in _execute
File "C:\Users\anthony\Documents\NetBeansProjects\EOLTest\lib\robotframework-2.6.2.jar\Lib\robot\__init__$py.class", line 123, in run
File "C:\Users\anthony\Documents\NetBeansProjects\EOLTest\lib\robotframework-2.6.2.jar\Lib\robot\running\model$py.class", line 37, in TestSuite
File "C:\Users\anthony\Documents\NetBeansProjects\EOLTest\lib\robotframework-2.6.2.jar\Lib\robot\common\model$py.class", line 306, in set_options
This problem seems to be causing problems to so many people that we'll take a look can it be easily fixed. The final fix is implementing better execution APIs ( issue 826 ), though.
It seems that the root cause for this is (accidental) use of shared mutable state between instances of RobotSettings and RebotSettings.
Creating these objects in sequence RobotSettings(); RebotSettings(); RobotSettings() causes the latter RobotSettings to be corrupted with Rebot options, which causes the reported error at later stage.
Luckily this is very easy to fix: dict.copy() is our friend here.
Activity
spooning commentedon Jun 29, 2014
I'm surprised this worked with 2.5.7. Could you attach relevant code here so that we can test this on our environment?
Notice that we also had issue 826 about enhancing the running APIs so that this would work better targeted for 2.6. Unfortunately there's no time to do this rather large cleanup at this point.
spooning commentedon Jun 29, 2014
I am attaching a wrapper class which should effectively allow you to reproduce the issue. Maybe it was not intended to be a feature but it was working with 2.5.7 nonetheless
It wasn't working perfectly though. Modifying a resource file still needed a restart. I guess that is due to left over cache not being updated.
I am already tracking issue 826 . I can work with however it was running in 2.5.7 till we enhance RF to support this properly. Hopefully in 2.7
spooning commentedon Jun 29, 2014
DISCLAIMER: These suggestions are in my opinion hacks.
Can you set report generation off in your test environment (--report NONE)?
As the remove_keywords method should be related to report generation. Hopefully there are no other errors..
One other thing that might make things work faster (I haven't tried this one though and don't know if RobotRunner even is Serializable) could be to serialize the whole RobotRunner instance (in memory and not to disc) before running it and deserialize a clone for every test re-run.
spooning commentedon Jun 29, 2014
Third option could be to create RobotRunners in another thread(s) during test execution.
This could speed up the RobotRunner creation as the Robot Framework runs in a single thread.
spooning commentedon Jun 29, 2014
Thanks Mikko. I will give these methods a try and see what works. What I am doing right now is a hack anyways, so I am not that concerned whether the suggestions are hacks or not : )
spooning commentedon Jun 29, 2014
-report NONE worked. I wasn't able to figure out where the issue lied. Thanks again Mikko.
I am fine with closing this issue till we properly implement issue 826
spooning commentedon Jun 29, 2014
Good to know that it works!
Closing issue.
spooning commentedon Jun 29, 2014
I'm running into the same issue when trying to run tests multiple times through Java. The -report None doesn't do it for me.
Is there a workaround?
RF 2.6.2, python 2.6.6, Java 1.6.0_22
Thanks
Anthony
spooning commentedon Jun 29, 2014
@anthony Did you type "--report" or "-report"? It should be "--report"
spooning commentedon Jun 29, 2014
Mikko,
Attaching a sample file. The output is pasted below. It fails on the second run.
spooning commentedon Jun 29, 2014
This problem seems to be causing problems to so many people that we'll take a look can it be easily fixed. The final fix is implementing better execution APIs ( issue 826 ), though.
spooning commentedon Jun 29, 2014
OK, thanks. Any estimate on a 2.6.3 release date?
spooning commentedon Jun 29, 2014
Issue 954 has been merged into this issue.
spooning commentedon Jun 29, 2014
It seems that the root cause for this is (accidental) use of shared mutable state between instances of RobotSettings and RebotSettings.
Creating these objects in sequence RobotSettings(); RebotSettings(); RobotSettings() causes the latter RobotSettings to be corrupted with Rebot options, which causes the reported error at later stage.
Luckily this is very easy to fix: dict.copy() is our friend here.
spooning commentedon Jun 29, 2014
This issue was updated by revision 4733712f4dd9.