Skip to content

[BUG] Browser library processes are not closed properly when running from VS Code #635

Closed

Description

@Lakitna

Describe the bug

Whenever I run a test that includes Browser Library from VSCode (using the play button) some of the process tree remains. They are zombie processes, since the parent python.exe processes are closed.

Example where I tested with Chromium (screenshot from System Informer):

Image

At first, I thought that this was a Browser Library issue, but it seems not the case. I tried all the following:

  • When I use the CLI with a robot command, it works as expected ✅
  • When I use the CLI with a pabot command, it works as expected ✅
  • When I use the CLI with a robotcode command, it works as expected ✅
  • When I use the VS Code play button provided by the robotcode extension, it creates zombie processes ❌
  • When I use the PyCharm play button provided by the robotcode extension, it works as expected ✅

There seems to be something specifically related to the VS Code extension.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Open a project that uses Browser Library in VS Code
  2. Find a test that opens a browser
  3. Run a test from the IDE using the play button
  4. Let the test finish (pass or fail, does not matter)
  5. Observe in the task manager that a node.exe process and multiple browser processes remain

Expected behavior
All processes close after test is done. No zombie processes remain.

Screenshots/ Videos
Not applicable

Logs
Not applicable

Additional context
I'm not sure which info to provide. So please let me know what info can help you with this :)

AI / tooling disclosure
Not applicable

Desktop (please complete the following information):

  • VS Code Version 1.128.0
  • PyCharm Version 2026.1.4
  • RobotCode Version 2.6.2
  • OS: Windows 11
  • Python Version 3.13.12
  • RobotFramework Version 7.2
  • Browser Library Version 19.10.0

Activity

  1. changed the title [-][BUG] Browser library processes are not closed properly when running from IDE[/-] [+][BUG] Browser library processes are not closed properly when running from VS Code[/+] on Jul 13, 2026
  2. d-biehl commented on Jul 14, 2026

    @d-biehl
    Member

    need to investigate this. maybe the debugger is terminating to early.

  3. Lakitna commented on Jul 15, 2026

    @Lakitna
    Author

    For completeness stake, and unsurprisingly, this also happens in robotcode v2.7.0

  4. RachmatKaligis commented on Sep 9, 2026

    @RachmatKaligis

    I can confirm this with my team, we have had the issue now for a while.

  5. d-biehl commented on Oct 21, 2026

    @d-biehl
    Member

    I found the cause. After a run from the Test Explorer or the play button, VS Code sends a terminate request to the debugger although the run has already ended. The debugger answered it by raising SIGINT in its own process, which at that point was only waiting for VS Code to disconnect, and the CLI ended on that interrupt with os._exit(253). os._exit skips Python's atexit handlers, and the Browser library stops its Playwright node process and the browsers in such a handler, so they were left behind. That's why it only happened with the play button in VS Code: the command line and PyCharm don't send terminate after the end of a run. As a side effect, every such run also ended with exit code 253 instead of Robot Framework's result.

    Fixed in 552a354: the debugger no longer interrupts its process once the run has ended. I reproduced the problem before the fix (Linux, Browser 20.6.0, headless Chromium: the node and Chromium processes stayed and the exit code was 253) and checked that nothing is left after it. The fix will be in the next release.

  6. d-biehl commented on Oct 21, 2026

    @d-biehl
    Member

    Closing this, since the fix is on main and will be in the next release. If the processes still stay behind with that release, please reopen this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions