robotcode icon indicating copy to clipboard operation
robotcode copied to clipboard

[BUG] Slow reaction time when running tests

Open DanielPenning opened this issue 1 year ago • 3 comments

Describe the bug Starting a test within RobotCode adds around 3s overhead compared to running the same .robot file from the CLI with robot. For short development loops this overhead is disturbing.

To Reproduce Steps to reproduce the behavior:

  1. Add a new file empty.robot in an otherwise empty directory.
*** Test Cases ***
First
    No Operation
  1. Run the suite or test by ckicking on the green icon left to it.

Expected behavior The command should execute the tests with almost the same speed than running the CLI. But:

  • CLI: robot empty.robot takes around 500ms
  • The IDE action takes around 3500ms (so a 3s overhead)

Desktop (please complete the following information):

  • VS Code Version: 1.91.1
  • RobotCode Version: v0.83.3
  • OS: Windows 10
  • Python Version: 3.10.6
  • RobotFramework Version: Robot Framework 7.0.1 (Python 3.10.6 on win32)
  • No other plugins installed in VS Code (clean profile). Default user settings.

DanielPenning avatar Aug 06 '24 06:08 DanielPenning

How is this noticeable? When I press the Run button, a new terminal opens, if one is not already open, and it starts within 1 second. Where are the 3 seconds lost? And how do you measure that? What is the start and what is the end point? Maybe you record a short video clip to show it?

You have to bear in mind that it can't be quite as fast as on the console, as VSCode also has to connect to the test run, a new terminal may be opened, etc.

d-biehl avatar Aug 06 '24 07:08 d-biehl

any news about this?

d-biehl avatar Aug 28 '24 15:08 d-biehl

https://github.com/user-attachments/assets/1be263a1-0dfb-488a-b27f-6d4ba767240b

Sorry for the late response. I created a short video. I measured this in a simple way: Manually with a stop watch.

The video shows about 2.5-3s delay - so this is a bit better than originally written above. The video was made with a bit more recent versions (VS Code 1.92.2, RobotCode v0.87.0).

@d-biehl Is this helpful for you to reproduce?

DanielPenning avatar Sep 02 '24 06:09 DanielPenning

@d-biehl Can I provide anything else that is helpful for you to track down this performance issue?

DanielPenning avatar Sep 17 '24 08:09 DanielPenning

I can't do it any faster because VSCode creates a new terminal session, attaches the test listener and connects to it and so on. If you don't close the terminal after the first start, it should go faster the next time.

Have you ever changed the shell, I use the new powershell pwsh, I have the feeling that it is faster.

You can also try to change the setting robotcode.debug.defaultConsole to internalConsole, then no extra terminal will be opened. However, you can then no longer open the report via ctrl+click, but the setting robotcode.run.openOutputAfterRun helps here.

d-biehl avatar Sep 24 '24 14:09 d-biehl

Thanks for your analysis.

  • I am already using the new pwsh 7.4.5.
  • It does not seem to make a difference if there is already a terminal open.
  • Changing robotcode.debug.defaultConsole to internalConsole does not seem to make a big difference, so I switched this back.

However I noticed something strange: VS Code uses a "Debugging" symbol for the powershell-tab that is opened by Robotcode. When I manually open a pwsh it uses a normal terminal-symbol. Is it expected that the terminal opened by Robotcode has this symbol?

grafik

DanielPenning avatar Oct 07 '24 07:10 DanielPenning

this is done by VSCode, because a debugging session is started and maybe this environment is different (other environment variables, python interpreter or whatever) then a normal terminal session.

Since I can't do anything here, I'm closing this topic. If you have any objections or new information, you can open it again.

d-biehl avatar Nov 19 '24 11:11 d-biehl