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
Opening large amount of tests in RIDE folder tree freezes #1668
enhancementRequest for improvement: either for an existing feature or a new onefixedIssues that have been fixed and can be closed alreadyprio-highCritical to user experience
I have a directory that contains 800 tests.
Those tests are foldered into multiple folders that have subfolders and so on.
If I open multiple folders / suites that contain tests at the same time, RIDE starts to freeze the whole computer.
I did not seem to notice any change in RAM or CPU usage.
The freezing happens so that when you are in RIDE and click on something - anything: a button in RIDE, some other program on task bar - anything.
The freezing can take from some seconds to for example 10 seconds or possibly more. Usually it is a relatively long time.
Once the freezing happens once, it happens from that point onwards until RIDE is closed and opened again.
You can try to reproduce this by having a directory that contains 5 folders.
Those folders contain 10 suites each.
The suites contain 1 to 10 tests each.
(Ok, lets just say that the whole left folder tree in RIDE is full of suites and tests. Completely white - having 40 suites open or similar)
When you open all this up in RIDE it will start to freeze. It may require a bit of waiting or fiddling around or trying to click on RIDE and some other program and then RIDE again multiple times or clicking something in RIDE to get the freezing to start happening.
It seems that I am not the only one having this problem as I have witnessed others having it as well.
RIDE is a nice tool compared to maintaining things manually in the text files - but this freezing keeps interrupting work and forces restarting RIDE multiple times every day.
tests.zip
Here is an example of some test data you can use to try freeze your RIDE.
It contains 160 folders that have 10 suits that have 10 tests each.
To use the data simply place it somewhere, open RIDE, click to open directory in RIDE and select the Tests folder. To test the freeze simply scroll the tree view up and down once by grabbing the scroll bar with your mouse and then try to change the window focus to any other program, like notepad for example. The system should freeze and you cannot do anything.
I tried profiling RIDE and disabling everything that seemed like a problem, but the freeze still exists.
I disabled for example _sendMessage in publisher entirely as it was called 100 000 times.
The profiling would suggest that the whole program time is almost entirely (not counting data loading) spent in the GUI MainLoop
I do confirm that this long tree of tests causes application freeze. In my system (Linux) the scrolling of the tree did not cause the freeze, but it happened when right-click and Select All Tests or Unselect All Tests.
There is an alternate version of RIDE in my fork (which includes some fixes, but not related to the tree). You may experiment it, to see if it makes any difference. Please note, that using wxPython 2.8.12.1 there should not be any unknown bugs, but with newer wxPython there are some.
I tested with all 31c8903 (latest release) dcdccfe (latest source in github) HelioGuilherme66@baf4bf1 (your fork latest release)
and the issue happens on all of them. I did not test the latest source from your repo since it requires newer invoke.
The latest RIDE source could not run the tests in the folders that had hypens in their names but the latest release from you and in RIDE repo can. The nice thing about your version was that utf8 errors dont appear in console even though the output still cannot handle the hypens in the folder names.
The way select all tests and similar actions have been coded certainly introduces a lot of lag. (expand all tree items and collapse them)
But that is not an issue for me/us as it happens only when you try to select a bunch of tests, so it happens when you expect it to happen and it will only freeze RIDE so you can still access other programs (which this issue we are in does not allow). Most of the time I/we dont run huge amounts of tests through RIDE, we only develop using RIDE so only small amounts of tests are run usually. RIDE has nice capabilities for selecting tests, pausing, stepping, editing documentation of tests and such.
Do note that the freeze in this issue does not only cause RIDE to freeze like selecting all tests does.
Instead the whole computer freezes when you select some other window as active in the windows UI. I believe RIDE is somehow making a huge deal of rendering something or similar. Its hard to analyse this as the whole windows UI is frozen, but I think the window management process was elevated for a moment in the task manager.
A small update:
I did some searching and found that after this change there seems to be no freeze:
C:\Python27\Lib\site-packages\robotide\ui\tree.py
def _create_node_with_handler(self, parent_node, controller, index=None):
handler_class = action_handler_class(controller)
node = self._create_node(parent_node, controller.display_name, self._images[controller],
index, with_checkbox=(handler_class == TestCaseHandler and self._checkboxes_for_tests))
if isinstance(controller, ResourceFileController):
if not controller.is_used():
self.SetItemTextColour(node, wx.ColorRGB(0xA9A9A9))
- self.SetPyData(node, handler_class(controller, self, node, self._controller.settings))+ self.SetPyData(node, None if handler_class is TestCaseFileHandler else handler_class(controller, self, node, self._controller.settings))
if controller.is_excluded():
self._set_item_excluded(node)
return node
Basically I made the action handler to be None for when it would use TestCaseFileController.
I tried changing None to wx.Window(self) as that seemed to be the class that TestCaseFileHandler inherited from at the very bottom, but the freeze still happened with it. ( I basically tried to remove all RIDE related code from the handler by doing this )
I tried to print how many of each controller was used and 3260, a huge amount, used TestCaseFileHandler.
Your solution of adding below line is not working
self.SetPyData(node, None if handler_class is TestCaseFileHandler else handler_class(controller, self, node, self._controller.settings))
Throws error for 'TestCaseFileHandler'.
Could you please help.... Getting frustated with slow response on windows 10 :(
Do note that the freeze in this issue does not only cause RIDE to freeze like selecting all tests does. Instead the whole computer freezes when you select some other window as active in the windows UI. I believe RIDE is somehow making a huge deal of rendering something or similar. Its hard to analyse this as the whole windows UI is frozen, but I think the window management process was elevated for a moment in the task manager.
I managed to figure out a few other things about this issue.
The 'freeze' doesn't actually affect windows, it only seems to prevent/delay all mouse events from taking action). You can test this by leaving a video running.
After the 'freeze' is over, all mouse events that were being delayed are released and take effect.
It's not necessary to click on another window, simply moving the mouse outside the RIDE frame causes it to occur. When doing this, EVT_MOTION is sent.
Keeping the mouse inside the RIDE frame will not trigger the 'freeze'.
The issue is definitely related in some way to the tree. When scrolling, a delay builds up. As long as you keep the mouse pointer inside the frame, it will expend in the background and you will be able to edit tests as you do normally, without any 'freeze'. But if you move the mouse outside the window, while this internal delay hasn't finished, then the 'freeze' will occur.
I've spent some time with casca to reproduce the issue on the current master version.
We have opened a directory containing many tests (thousands).
Loading the directory takes about 1 minute (which might be acceptable).
We opened 3 nodes so to have about 20-30 nodes visible.
We have observed two bad behaviors.
When we try to scroll on the "Test Suites" tree, RIDE and Windows 10 freeze for a couple of minutes.
If we try the same on Mac OS X 10.15, we observe slowness on the response of the scroll (which suggests heavy computation) but the rest of the OS GUI remains responsive.
if we right click on the root and "Select All Tests", RIDE and Windows freeze for several minutes (>15 minutes).
The same scenario on Mac freezes RIDE for about the same time. The OS GUI remains responsive.
The general impression is that the UI is better segregated on Mac, compared to Window.
Replicating the second scenario, we have stopped the execution with the debugger. And that showed the following stack of the Main thread.
We're not Python experts, but the select all tests causes to
Expand recursively all the sub-nodes
Which causes the rendering of the sub-nodes.
At the end all the expanded nodes are collapsed back.
@valeriobruno Unfortunatelly the same testing did not work on Windows.
We have in master, since today, a fix to allow staring RIDE with Tree or File Explorer panels disabled or hidden. This allowed to have a loading time before stabilization of 9 seconds (on the previous system and test folder). This is the chart:
Assuming that the behavior is the same on Windows, users can hide the Tree panel, before loading large test suites folders, of they must enable it again when wanting to navigate on files or test suites.
Great news!! Does this also fix the freeze-upon-scrolling problem?
It should at least reduce the scrolling problem. With this fix, only the nodes explicitly opened by the user are attached to the WX Tree. Therefore, the WX Tree must handle few nodes (as opposed to ALL).
@HelioGuilherme66
I have recently try to open project ( 500+ test cases and many resources ) using most recent sources (Oct 3, 2020) from RIDE using Python 3.8.
Total time increase from less than 30 sec to more then 5 mins
enhancementRequest for improvement: either for an existing feature or a new onefixedIssues that have been fixed and can be closed alreadyprio-highCritical to user experience
Activity
Rochet2 commentedon May 20, 2017
tests.zip
Here is an example of some test data you can use to try freeze your RIDE.
It contains 160 folders that have 10 suits that have 10 tests each.
To use the data simply place it somewhere, open RIDE, click to open directory in RIDE and select the Tests folder. To test the freeze simply scroll the tree view up and down once by grabbing the scroll bar with your mouse and then try to change the window focus to any other program, like notepad for example. The system should freeze and you cannot do anything.
I tried profiling RIDE and disabling everything that seemed like a problem, but the freeze still exists.
I disabled for example _sendMessage in publisher entirely as it was called 100 000 times.
The profiling would suggest that the whole program time is almost entirely (not counting data loading) spent in the GUI MainLoop

HelioGuilherme66 commentedon May 21, 2017
I do confirm that this long tree of tests causes application freeze. In my system (Linux) the scrolling of the tree did not cause the freeze, but it happened when right-click and Select All Tests or Unselect All Tests.
There is an alternate version of RIDE in my fork (which includes some fixes, but not related to the tree). You may experiment it, to see if it makes any difference. Please note, that using wxPython 2.8.12.1 there should not be any unknown bugs, but with newer wxPython there are some.
Rochet2 commentedon May 21, 2017
I tested with all
31c8903 (latest release)
dcdccfe (latest source in github)
HelioGuilherme66@baf4bf1 (your fork latest release)
and the issue happens on all of them. I did not test the latest source from your repo since it requires newer invoke.
The latest RIDE source could not run the tests in the folders that had hypens in their names but the latest release from you and in RIDE repo can. The nice thing about your version was that utf8 errors dont appear in console even though the output still cannot handle the hypens in the folder names.
The way select all tests and similar actions have been coded certainly introduces a lot of lag. (expand all tree items and collapse them)
But that is not an issue for me/us as it happens only when you try to select a bunch of tests, so it happens when you expect it to happen and it will only freeze RIDE so you can still access other programs (which this issue we are in does not allow). Most of the time I/we dont run huge amounts of tests through RIDE, we only develop using RIDE so only small amounts of tests are run usually. RIDE has nice capabilities for selecting tests, pausing, stepping, editing documentation of tests and such.
Do note that the freeze in this issue does not only cause RIDE to freeze like selecting all tests does.
Instead the whole computer freezes when you select some other window as active in the windows UI. I believe RIDE is somehow making a huge deal of rendering something or similar. Its hard to analyse this as the whole windows UI is frozen, but I think the window management process was elevated for a moment in the task manager.
Rochet2 commentedon May 23, 2017
A small update:
I did some searching and found that after this change there seems to be no freeze:
C:\Python27\Lib\site-packages\robotide\ui\tree.py
def _create_node_with_handler(self, parent_node, controller, index=None): handler_class = action_handler_class(controller) node = self._create_node(parent_node, controller.display_name, self._images[controller], index, with_checkbox=(handler_class == TestCaseHandler and self._checkboxes_for_tests)) if isinstance(controller, ResourceFileController): if not controller.is_used(): self.SetItemTextColour(node, wx.ColorRGB(0xA9A9A9)) - self.SetPyData(node, handler_class(controller, self, node, self._controller.settings)) + self.SetPyData(node, None if handler_class is TestCaseFileHandler else handler_class(controller, self, node, self._controller.settings)) if controller.is_excluded(): self._set_item_excluded(node) return nodeBasically I made the action handler to be None for when it would use TestCaseFileController.
I tried changing None to wx.Window(self) as that seemed to be the class that TestCaseFileHandler inherited from at the very bottom, but the freeze still happened with it. ( I basically tried to remove all RIDE related code from the handler by doing this )
I tried to print how many of each controller was used and 3260, a huge amount, used TestCaseFileHandler.
narayanyadav007 commentedon Oct 25, 2018
Hi Rochet2,
Your solution of adding below line is not working
self.SetPyData(node, None if handler_class is TestCaseFileHandler else handler_class(controller, self, node, self._controller.settings))
Throws error for 'TestCaseFileHandler'.
Could you please help.... Getting frustated with slow response on windows 10 :(
OR Can anybody help me on this ???
pakal commentedon Sep 20, 2019
Maybe have a look at #2017 and tell if this bugfix helps in your case
HelioGuilherme66 commentedon Sep 20, 2019
@pakal The fix you propose is on code that was added much after 1.5.2.1.
Nyral commentedon Sep 20, 2019
The fix mentioned by pakal is not related to this issue.
Nyral commentedon Dec 13, 2019
@Rochet2 @Soothsilver @HelioGuilherme66
I managed to figure out a few other things about this issue.
Soothsilver commentedon Dec 16, 2019
Okay, wow, good job. Now I really want to know what's causing this.
Somebody could also send this to Microsoft. It could be a bug in Windows and we now have a perfect repro case, even if it's somewhat involved.
(This seems related to #1843.)
Nyral commentedon Dec 17, 2019
@Soothsilver Thanks, but I still need to separate the tree from RIDE first, in order to eliminate any other possibility.
Yes, it's the same issue. We should probably merge them at some point.
valeriobruno commentedon May 8, 2020
Hello guys.
I've spent some time with casca to reproduce the issue on the current master version.
We have opened a directory containing many tests (thousands).
Loading the directory takes about 1 minute (which might be acceptable).
We opened 3 nodes so to have about 20-30 nodes visible.
We have observed two bad behaviors.
When we try to scroll on the "Test Suites" tree, RIDE and Windows 10 freeze for a couple of minutes.
If we try the same on Mac OS X 10.15, we observe slowness on the response of the scroll (which suggests heavy computation) but the rest of the OS GUI remains responsive.
if we right click on the root and "Select All Tests", RIDE and Windows freeze for several minutes (>15 minutes).
The same scenario on Mac freezes RIDE for about the same time. The OS GUI remains responsive.
The general impression is that the UI is better segregated on Mac, compared to Window.
Replicating the second scenario, we have stopped the execution with the debugger. And that showed the following stack of the Main thread.

We're not Python experts, but the select all tests causes to
At the end all the expanded nodes are collapsed back.
treeplugin.py
Does anybody know why we expand all the sub-nodes, when we really want just to select (ie graphically highlight) the currently expanded nodes?
cc: @HelioGuilherme66
Thanks.
5 remaining items
HelioGuilherme66 commentedon Jun 10, 2020
@valeriobruno Unfortunatelly the same testing did not work on Windows.
We have in master, since today, a fix to allow staring RIDE with Tree or File Explorer panels disabled or hidden. This allowed to have a loading time before stabilization of 9 seconds (on the previous system and test folder). This is the chart:

Assuming that the behavior is the same on Windows, users can hide the Tree panel, before loading large test suites folders, of they must enable it again when wanting to navigate on files or test suites.
valeriobruno commentedon Jun 16, 2020
Pull request: #2210
HelioGuilherme66 commentedon Jun 18, 2020
@valeriobruno @Rochet2 @Soothsilver @Nyral Great news. The freeze is gone with @valeriobruno PR.


See here:
Before fix:
After fix:
My system: Windows 7 Professional x64, Python 3.7.6, wxPython 4.0.7.post2, RF 3.2.1.
Soothsilver commentedon Jun 18, 2020
HelioGuilherme66 commentedon Jun 18, 2020
I think so. I did scrolled, it was a bit slow, but no crash.
valeriobruno commentedon Jun 18, 2020
It should at least reduce the scrolling problem. With this fix, only the nodes explicitly opened by the user are attached to the WX Tree. Therefore, the WX Tree must handle few nodes (as opposed to ALL).
jnhyperion commentedon Jul 20, 2020
with this PR: #2237
this issue should be totally resolved.
IlfirinPL commentedon Oct 8, 2020
@HelioGuilherme66
I have recently try to open project ( 500+ test cases and many resources ) using most recent sources (Oct 3, 2020) from RIDE using Python 3.8.
Total time increase from less than 30 sec to more then 5 mins
Using profile command
python -m profile -o ride.profile -s tottime -m robotide.init
its show most of time is related with "~:0(<method 'acquire' of '_thread.lock' objects>)"
I have attached profile file
ride.profile.zip
HelioGuilherme66 commentedon Oct 8, 2020
@jnhyperion Ping. Please take a look to this, thanks.
IlfirinPL commentedon Apr 6, 2021
@HelioGuilherme66 I can confirm latest changes improve performance tremendous ( now now open under 3 sec vs 5 min)
HelioGuilherme66 commentedon Apr 6, 2021
@IlfirinPL Great. Thanks for the feedback.
The fix was made by @JFoederer so all the credits goes to him!