Skip to content

Versions 2.4.0 and later crash when the test case is started inside VSCode using the RobotCode (d-biehl.robotcode) extension. #77

@JasonFerrara

Description

@JasonFerrara

With robotframework-debuglibrary 2.40 and later, when the Debug keyword is called in a test case started in VSCode using the RobotCode extension instead of getting the interactive debug prompt you get...

| FAIL | asyncio.run() cannot be called from a running event loop

Version 2.3.0 works as expected.

Attached is a sample VSCode project that show the problem. Open the project in VSCode, click "Reopen in Container". After the project reloads open the debugtest.robot file and click the run button next to the Check DebugLibrary test case. Instead of the interactive prompt you'll get...

 /workspaces/robotdebuglibrarybug #  /usr/bin/env /usr/bin/python /root/.vscode-server/extensions/d-biehl.robotcode-0.69.0/bundled/tool/robotcode --default-path . debug --
no-debug -- --parse-include debugtest.robot --name Robotdebuglibrarybug --suite Robotdebuglibrarybug.Debugtest --by-longname Robotdebuglibrarybug.Debugtest.Check\ DebugLi
brary 
==============================================================================
Robotdebuglibrarybug                                                          
==============================================================================
Robotdebuglibrarybug.Debugtest                                                
==============================================================================
Check DebugLibrary                                                    
>>>>> Enter interactive shell
Only accepted plain text format keyword separated with two or more spaces.
Type "help" for more information.
Check DebugLibrary                                                    | FAIL |
asyncio.run() cannot be called from a running event loop
------------------------------------------------------------------------------
Robotdebuglibrarybug.Debugtest                                        | FAIL |
1 test, 0 passed, 1 failed
==============================================================================
Robotdebuglibrarybug                                                  | FAIL |
1 test, 0 passed, 1 failed
==============================================================================
Output:  /workspaces/robotdebuglibrarybug/results/output.xml
Log:     /workspaces/robotdebuglibrarybug/results/log.html
Report:  /workspaces/robotdebuglibrarybug/results/report.html
sys:1: RuntimeWarning: coroutine 'Application.run_async' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/workspaces/robotdebuglibrarybug # 

If you edit the Dockerfile to install robotframework-debuglibrary 2.3.0 instead of 2.5.0 when you run the test case you'll get...

/workspaces/robotdebuglibrarybug #  /usr/bin/env /usr/bin/python /root/.vscode-server/extensions/d-biehl.robotcode-0.69.0/
bundled/tool/robotcode --default-path . debug --no-debug -- --parse-include debugtest.robot --name Robotdebuglibrarybug --
suite Robotdebuglibrarybug.Debugtest --by-longname Robotdebuglibrarybug.Debugtest.Check\ DebugLibrary 
==============================================================================
Robotdebuglibrarybug                                                          
==============================================================================
Robotdebuglibrarybug.Debugtest                                                
==============================================================================
Check DebugLibrary                                                    
>>>>> Enter interactive shell
Only accepted plain text format keyword separated with two or more spaces.
Type "help" for more information.
>    

as expected.
robotdebuglibrarybug.tar.gz

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions