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: THREAD builtin causes exception if part of keyword #49

Closed test-fullautomation closed 6 days ago

test-fullautomation commented 1 year ago

THREAD builtin causes exception if part of keyword.

*** Settings ***
Library    Collections
Library    String

*** Keywords ***

#
#    Threading payload base keywords
#
################################################################################
threading_from_keyword_base.dispatch
    THREAD    TEST_THREAD1    False
        Log    This is a message    console=True
    END

*** Test Cases ***
Threading From Keyword Base
    threading_from_keyword_base.dispatch
    #
    Sleep    5

results in:

$  cd C:\\RobotTest\\testcases ; /usr/bin/env C:\\Users\\pol2hi\\AppData\\Local\\Temp\\rf-ls-run\\run_env_00_4ilaoy0z.bat -u c:\\Program\ Files\\RobotFramework\\robotvscode\\data\\extensions\\robocorp.robotframework-lsp-1.11.0\\src\\robotframework_debug_adapter\\run_robot__main__.py --port 62252 --no-debug -T -d C:\\RobotTest\\testcases\\..\\logfiles -b debug\\hanging_thread.log -l htmllog\\hanging_thread_log.html -o xmloutput\\hanging_thread_output.xml -r htmlreport\\hanging_thread_report.html c:\\RobotTest\\testcases\\hanging_thread.robot 
[ ERROR ] Unexpected error: AttributeError: 'KeywordBuilder' object has no attribute 'model'
Traceback (most recent call last):
  File "C:\Program Files\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\utils\application.py", line 81, in _execute
    rc = self.main(arguments, **options)
  File "C:\Program Files\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\run.py", line 446, in main
    suite = builder.build(*datasources)
  File "C:\Program Files\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\running\builder\builders.py", line 156, in build
    suite = SuiteStructureParser(self._get_parsers(paths), self.defaults,
  File "C:\Program Files\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\running\builder\builders.py", line 217, in parse
    structure.visit(self)
  File "C:\Program Files\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\parsing\suitestructure.py", line 65, in visit
    visitor.visit_file(self)
  File "C:\Program Files\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\running\builder\builders.py", line 224, in visit_file
    suite = self._build_suite_file(structure)
  File "C:\Program Files\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\running\builder\builders.py", line 250, in _build_suite_file
    suite = parser.parse_suite_file(source, defaults)
  File "C:\Program Files\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\running\builder\parsers.py", line 58, in parse_suite_file
    SuiteBuilder(suite, FileSettings(defaults)).build(model)
  File "C:\Program Files\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\running\builder\transformers.py", line 102, in build
    self.visit(model)
  File "C:\Program Files\RobotFramework\python39\lib\ast.py", line 407, in visit
    return visitor(node)
  File "C:\Program Files\RobotFramework\python39\lib\ast.py", line 415, in generic_visit
    self.visit(item)
  File "C:\Program Files\RobotFramework\python39\lib\ast.py", line 407, in visit
    return visitor(node)
  File "C:\Program Files\RobotFramework\python39\lib\ast.py", line 415, in generic_visit
    self.visit(item)
  File "C:\Program Files\RobotFramework\python39\lib\ast.py", line 407, in visit
    return visitor(node)
  File "C:\Program Files\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\running\builder\transformers.py", line 126, in visit_Keyword
    KeywordBuilder(self.suite.resource, self.settings).visit(node)
  File "C:\Program Files\RobotFramework\python39\lib\ast.py", line 407, in visit
    return visitor(node)
  File "C:\Program Files\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\running\builder\transformers.py", line 286, in visit_Keyword
    self.generic_visit(node)
  File "C:\Program Files\RobotFramework\python39\lib\ast.py", line 415, in generic_visit
    self.visit(item)
  File "C:\Program Files\RobotFramework\python39\lib\ast.py", line 407, in visit
    return visitor(node)
  File "C:\Program Files\RobotFramework\python39\lib\site-packages\robotframework-6.1-py3.9.egg\robot\running\builder\transformers.py", line 337, in visit_Thread
    ThreadBuilder(self.model).build(node)
AttributeError: 'KeywordBuilder' object has no attribute 'model'
HolQue commented 7 months ago

Also if not part of a keyword:

https://github.com/test-fullautomation/robotframework/issues/77

test-fullautomation commented 2 months ago

Hi @milanac030988 , what is the status of this issue? Thank you, Thomas

test-fullautomation commented 1 week ago

Hi @milanac030988 , what is the status of this issue? Thank you, Thomas

milanac030988 commented 1 week ago

Hello Thomas,

It was fixed by https://github.com/test-fullautomation/robotframework/pull/73 for a long time.

Thanks, Cuong