Skip to content

Executing run multiple times on RobotRunner fails #881

Closed

Description

@spooning

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.

This worked fine with 2.5.7

Activity

  1. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 19 Jun 2011

    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.

  2. added this to the 2.6.3 milestone on Jun 29, 2014
  3. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    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

  4. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @mkorpela on 29 Jul 2011

    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.

  5. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @mkorpela on 30 Jul 2011

    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.

  6. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    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 : )

  7. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by imranoftherings on 3 Aug 2011

    -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

  8. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @mkorpela on 3 Aug 2011

    Good to know that it works!

    Closing issue.

  9. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by anthony.gilley on 4 Oct 2011

    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

  10. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @mkorpela on 4 Oct 2011

    @⁠anthony Did you type "--report" or "-report"? It should be "--report"

  11. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    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
    
  12. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 5 Oct 2011

    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.

  13. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by anthony.gilley on 5 Oct 2011

    OK, thanks. Any estimate on a 2.6.3 release date?

  14. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 5 Oct 2011

    Issue 954 has been merged into this issue.

  15. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @yanne on 5 Oct 2011

    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.

  16. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @yanne on 5 Oct 2011

    This issue was updated by revision 4733712f4dd9.

  17. added theissue type on Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions