test-fullautomation / robotframework

Generic automation framework for acceptance testing and RPA
http://robotframework.org
Apache License 2.0
1 stars 0 forks source link

Threading Issue - IndexError: pop from an empty deque #91

Open bhd1hi opened 1 week ago

bhd1hi commented 1 week ago

Dear RobotFramework AIO Team,

An issue has encountered while running the threading sample tests included in RobotFramework AIO version 0.13.0.

Error Description:

The test execution resulted in the following error messages and warnings:

Main Error: IndexError: pop from an empty deque First Error Message: entry = self._stack_ctx_entries_deque.pop() Tracebacks: The error includes tracebacks referencing lines within robotframework_debug_adapter\listeners.py. Additional Warnings: RFStream Warning: unable to pop keyword - voltage.Validate All Channels Voltage (empty queue). RFStream Warning: keyword - BuiltIn.Log did not have a corresponding pop. RFStream Warning: keyword - bits_platform.Selftest Set Single Parameter did not have a corresponding pop. Context: The error occurred specifically when executing the threading sample tests. Additional Information: The error message also mentions: + Exception Error has occured while processing device unit1. Error Message: [ 'str' object has no attribute 'test_case_errors' ] We are unsure if this additional message is directly related to the main IndexError.

We would appreciate any insights or suggestions you might have to help us resolve this issue. Please let us know if you require any further information.

Thank you for your time and support. Best regards, Datta

HolQue commented 1 week ago

Related to https://github.com/test-fullautomation/robotframework/issues/38

HolQue commented 1 week ago

Language server issue (as part of test execution VSCodium). Errors do not occur in case of execution by batch file in standard console. Test execution in console would be an intermediate temporary solution until language server is fixed.

test-fullautomation commented 1 week ago

Hi @bhd1hi , please check if the same issue happens when you execute the test without VSCodium, but instead directly in console. Please give feedback. Thank you, Thomas

bhd1hi commented 1 week ago
Hello @test-fullautomation, We have tried to run the test on the console outside of VSCodium. However, it throws another error as bellow since the console could not get ta_framework path from the environment variable. D:\ta_framework_2.0.0\project\test>devbits_platform_thead_sample_v03.robot
[ UNKNOWN ] Error in file 'D:\ta_framework_2.0.0\project\test\dev
bits_platform_thead_sample_v03.robot' on line 5: Replacing variables from setting 'Resource' failed: Variable '${TAF_PATH}' not found.
==============================================================================
Bits Platform Thead Sample V03 :: Connect to BITS-Platform and run its api ...
==============================================================================
Threading sample test on console
UNKNOWN
Bits Platform Thead Sample V03 :: Connect to BITS-Platform and run... UNKNOWN

1 test, 0 passed, 0 failed, 1 unknown
==============================================================================
Output: D:\ta_framework_2.0.0\project\test\output.xml
Log: D:\ta_framework_2.0.0\project\test\log.html
Report: D:\ta_framework_2.0.0\project\test\report.html

test-fullautomation commented 1 week ago

Puhh... Looks like that the TA-Framework has a dependency to VSCodium. I check this with Alexander tomorrow and come back to you.

bhd1hi commented 1 week ago

It is just for your information. Here is some more additional error and log relating to the threading module issue. This exception occurred when I tried to run the threading sample test again.
The exception occurred error message is "An exception occurred in 'SELFTEST_1' thread. Exception: RobotNotRunningError: Cannot access execution context' "

Thread_1 set_single_parameter: True [ WARN===>ack: ] An exception occurred in 'SELFTEST_1' thread. Exception: RobotNotRunningError: Cannot access execution context' ===>result : FAIL ===>ack: ===>result : FAIL ===>ack: ===>result : FAIL ===>ack: [ WARN ] An exception occurred in 'SELFTEST_2' thread. Exception: RobotNotRunningError: Cannot access execution context' Log: D:\ta_framework_2.0.0\log.html Report: D:\ta_framework_2.0.0\report.html -- Closing logging streams --

test-fullautomation commented 1 week ago

Hi @bhd1hi , As per Alexander the only dependency is the to VSCodium are the command line arguments VSCodium uses when the test is started. Can you please check the command line arguments and start the TA-Framework tests the same way. Thank you, Thomas

bhd1hi commented 1 week ago

@test-fullautomation, As you suggested, we attempted to run the test from the command-line terminal and passed the following command-line arguments. However, this resulted in another error.

The command-line arguments we used were:

PS D:\ta_framework_1.3.0> & 'C:\Users\bhd1hi\AppData\Local\Temp\rf-ls-run\run_env_00_y53xpdip.bat' '-u' 'c:\RobotFramework\robotvscode\data\extensions\robocorp.robotframework-lsp-1.11.0\src\robotframework_debug_adapter\run_robotmain.py ' '--port' '54923' '--no-debug' '--listener=robotframework_debug_adapter.events_listener.EventsListenerV2' '--listener=robotframework_debug_adapter.events_listener.EventsListenerV3' '--pythonpath' 'C:\BITSPlatform' '--pythonpath' 'C:\BITS RF\db_client/interfaces' '--pythonpath' 'd:\ta_framework_2.0.0' '--variable' 'TESTBENCH_CONFIG_PATH:project/testbench/bench_local' '--variable' 'SUT_CONFIG_PATH:project/sut/default' '--variable' 'SETUP_CONFIG_PATH:project/setup/default' '-- variable' 'TEST_CONFIG_PATH:project/test/default' '--variable' 'FRAMEWORK_CONFIG_PATH:project/framework/default' '--variable' 'testbench_configuration:bench_local' '--variable' 'sut_configuration:default' '--variable' 'setup_configuration:d efault' '--variable' 'test_configuration:default' '--variable' 'framework_configuration:default' '--variable' 'BP_PATH:C:\BITS_Platform' '--variable' 'TAF_PATH:D:/ta_framework_2.0.0' '--prerunmodifier=robotframework_debug_adapter.prerun_mod ifiers.FilteringTestsSuiteVisitor' '--suite' 'ta_framework_2.0.0.project.test.bits_platform_thead_sample_v03' 'd:\ta_framework_2.0.0'

=======output log===========
robot: 2024-09-04 14:44:35 UTC pid: 22164 - MainThread - EXCEPTION - robotframework_debug_adapter.run_robotmain.py
Could not connect to: 54923

Traceback (most recent call last):
File "c:\RobotFramework\robotvscode\data\extensions\robocorp.robotframework-lsp-1.11.0\src\robotframework_debug_adapter\run_robotmain.py", line 48, in connect
s.connect(("127.0.0.1", port))
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
Traceback (most recent call last):
File "c:\RobotFramework\robotvscode\data\extensions\robocorp.robotframework-lsp-1.11.0\src\robotframework_debug_adapter\run_robotmain.py", line 673, in
main()
File "c:\RobotFramework\robotvscode\data\extensions\robocorp.robotframework-lsp-1.11.0\src\robotframework_debug_adapter\run_robotmain.py", line 608, in main
s = connect(port)
File "c:\RobotFramework\robotvscode\data\extensions\robocorp.robotframework-lsp-1.11.0\src\robotframework_debug_adapter\run_robotmain.py", line 48, in connect
s.connect(("127.0.0.1", port))
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
PS D:\ta_framework_1.3.0>