RAFCON icon indicating copy to clipboard operation
RAFCON copied to clipboard

error in test__destruct on ubuntu 18.04

Open franzlst opened this issue 4 years ago • 3 comments

When executing the test__destruct.py::test_complex_model_and_core_destruct_with_gui, I get the following output and stacktrace (this is independent from the python version I use):

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Captured stdout ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
of object of kind '<class 'rafcon.core.states.state.State'>' have been generated 0 and there are 0 left over instances 
of object of kind '<class 'rafcon.core.state_elements.state_element.StateElement'>' have been generated 0 and there are 0 left over instances 
of object of kind '<class 'rafcon.gui.models.abstract_state.AbstractStateModel'>' have been generated 0 and there are 0 left over instances 
of object of kind '<class 'rafcon.gui.models.state_element.StateElementModel'>' have been generated 0 and there are 0 left over instances 
of object of kind '<class 'rafcon.gui.controllers.utils.extended_controller.ExtendedController'>' have been generated 0 and there are 0 left over instances 
of object of kind '<class 'gtkmvc3.view.View'>' have been generated 0 and there are 0 left over instances 
of object of kind '<class 'gtkmvc3.controller.Controller'>' have been generated 0 and there are 0 left over instances 
of object of kind '<class 'rafcon.gui.models.container_state.ContainerStateModel'>' have been generated None and there are 0 left over instances 
ignored_objects []
found_objects []
target_objects []
patch
<function ModelMT.__notify_observer__ at 0x7fef549e70d0> <function patch_gtkmvc3_model_mt.<locals>._patched_run_active_state_machine at 0x7fef2959de18> <function State.start at 0x7fef55710f28>
WT thread:  <_MainThread(MainThread, started 140666359576384)> 140666359576384
used_gui_threads [<Thread(Thread-365, stopped 140665799300864)>, <Thread(Thread-369, stopped 140665816086272)>, <Thread(Thread-371, stopped 140665761015552)>, <Thread(Thread-380, stopped 140665761015552)>, <Thread(Thread-396, stopped 140665761015552)>, <Thread(Thread-398, started 140665761015552)>]
2019-03-08 14:52:31:    DEBUG - rafcon.gui.config:  Configuration loaded from /home/brunner/develop/RAFCON/source/rafcon/gui/gui_config.yaml
2019-03-08 14:52:31:    DEBUG - rafcon.gui.runtime_config:  Configuration loaded from /home/brunner/.config/rafcon/runtime_config.yaml
2019-03-08 14:52:31:     INFO - rafcon.gui.controllers.library_tree:  Library tree has been initialized
run_gui thread:  <Thread(Thread-398, started 140665761015552)> 140665761015552 gui.singleton thread ident: 140665799300864
2019-03-08 14:52:31:    DEBUG - rafcon.core.config:  Configuration loaded from /home/brunner/develop/RAFCON/source/rafcon/core/config.yaml
2019-03-08 14:52:31:    DEBUG - rafcon.core.library_manager:  Initializing LibraryManager: Loading libraries ... 
2019-03-08 14:52:31:    DEBUG - rafcon.core.library_manager:  Adding library root key 'generic' from path '/home/brunner/develop/RAFCON/share/libraries/generic'
2019-03-08 14:52:31:    DEBUG - rafcon.core.library_manager:  Initialization of LibraryManager done
2019-03-08 14:52:31:     INFO - rafcon.gui.controllers.library_tree:  Libraries have been updated
2019-03-08 14:52:31:    DEBUG - rafcon.core.library_manager:  Initializing LibraryManager: Loading libraries ... 
2019-03-08 14:52:31:    DEBUG - rafcon.core.library_manager:  Adding library root key 'generic' from path '/home/brunner/develop/RAFCON/share/libraries/generic'
2019-03-08 14:52:31:    DEBUG - rafcon.core.library_manager:  Initialization of LibraryManager done
2019-03-08 14:52:31:     INFO - rafcon.gui.controllers.main_window:  Ready
patch with:  <function patch_model_classes_with_log at 0x7fef54bbf620>
check file:  /tmp/rafcon-brunner/3941/abstract_state_model_gen_log_file.txt
exists after:  /tmp/rafcon-brunner/3941/abstract_state_model_gen_log_file.txt
check file:  /tmp/rafcon-brunner/3941/state_element_model_gen_log_file.txt
exists after:  /tmp/rafcon-brunner/3941/state_element_model_gen_log_file.txt
patch with:  <function patch_ctrl_classes_with_log at 0x7fef54bbf730>
check file:  /tmp/rafcon-brunner/3941/extended_controller_gen_log_file.txt
exists after:  /tmp/rafcon-brunner/3941/extended_controller_gen_log_file.txt
patch with:  <function patch_gtkmvc3_classes_with_log at 0x7fef54bbf840>
check file:  /tmp/rafcon-brunner/3941/gtkmvc3_view_gen_log_file.txt
exists after:  /tmp/rafcon-brunner/3941/gtkmvc3_view_gen_log_file.txt
check file:  /tmp/rafcon-brunner/3941/gtkmvc3_controller_gen_log_file.txt
exists after:  /tmp/rafcon-brunner/3941/gtkmvc3_controller_gen_log_file.txt
patch with:  <function patch_core_classes_with_log at 0x7fef6d7af1e0>
check file:  /tmp/rafcon-brunner/3941/state_gen_log_file.txt
exists after:  /tmp/rafcon-brunner/3941/state_gen_log_file.txt
check file:  /tmp/rafcon-brunner/3941/state_element_gen_log_file.txt
exists after:  /tmp/rafcon-brunner/3941/state_element_gen_log_file.txt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
before test function print
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2019-03-08 14:52:31:    DEBUG - rafcon.core.state_machine_manager:  Add new state machine with id 99
Both threads are former gui threads! Current thread <Thread(Thread-398, started 140665761015552)>, Observer thread <Thread(Thread-365, stopped 140665799300864)>
2019-03-08 14:52:31:    DEBUG - rafcon.gui.models.state_machine_manager:  Add new state machine model ... 
2019-03-08 14:52:31:    DEBUG - rafcon.gui.models.state_machine_manager:  Create new state machine model for state machine with id 99
2019-03-08 14:52:32:     INFO - rafcon.gui.models.state_machine:  The modification history is disabled
2019-03-08 14:52:32:    DEBUG - rafcon.gui.controllers.state_machines_editor:  Create new graphical editor for state machine with id 99
2019-03-08 14:52:32:  VERBOSE - rafcon.gui.controllers.graphical_editor_gaphas:  Time spent in init 0.0012867450714111328 seconds for state machine 99
2019-03-08 14:52:32:  VERBOSE - rafcon.gui.controllers.graphical_editor_gaphas:  start setup canvas
2019-03-08 14:52:32:    DEBUG - rafcon.gui.controllers.graphical_editor_gaphas:  Hash has changed from e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 to 7e777b3b7040fa1286282f96e6e7d43535f22f7536e532c46bd371d844b809d0
2019-03-08 14:52:32:     INFO - rafcon.gui.controllers.graphical_editor_gaphas:  Opening the state machine caused some meta data to be generated, which will be stored  when the state machine is being saved.
2019-03-08 14:52:32:  VERBOSE - rafcon.gui.controllers.graphical_editor_gaphas:  Time spent in setup canvas 0.06807279586791992 state machine 99
2019-03-08 14:52:32:    DEBUG - rafcon.core.state_machine_manager:  Add new state machine with id 100
Both threads are former gui threads! Current thread <Thread(Thread-398, started 140665761015552)>, Observer thread <Thread(Thread-365, stopped 140665799300864)>
2019-03-08 14:52:32:    DEBUG - rafcon.gui.models.state_machine_manager:  Add new state machine model ... 
2019-03-08 14:52:32:    DEBUG - rafcon.gui.models.state_machine_manager:  Create new state machine model for state machine with id 100
2019-03-08 14:52:32:     INFO - rafcon.gui.models.state_machine:  The modification history is disabled
2019-03-08 14:52:32:    DEBUG - rafcon.gui.controllers.state_machines_editor:  Create new graphical editor for state machine with id 100
2019-03-08 14:52:32:  VERBOSE - rafcon.gui.controllers.graphical_editor_gaphas:  Time spent in init 0.0016849040985107422 seconds for state machine 100
2019-03-08 14:52:32:  VERBOSE - rafcon.gui.controllers.graphical_editor_gaphas:  start setup canvas
2019-03-08 14:52:32:    DEBUG - rafcon.gui.controllers.graphical_editor_gaphas:  Hash has changed from e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 to 5d7fe701d1f4cc62480b42992e89d25455fecc1e6a32ba051387eb5cb772ad2f
2019-03-08 14:52:32:     INFO - rafcon.gui.controllers.graphical_editor_gaphas:  Opening the state machine caused some meta data to be generated, which will be stored  when the state machine is being saved.
2019-03-08 14:52:32:  VERBOSE - rafcon.gui.controllers.graphical_editor_gaphas:  Time spent in setup canvas 0.06969237327575684 state machine 100
2019-03-08 14:52:33:    DEBUG - rafcon.tests.gui.widget.test_states_editor:  wait for state's state editor 0.10009179115295411
2019-03-08 14:52:33:    DEBUG - rafcon.gui.helpers.state_machine:  Change type of State 'State3' from HierarchyState to BarrierConcurrencyState
2019-03-08 14:52:33:     INFO - rafcon.gui.helpers.state:  Type change from HierarchyState to BarrierConcurrencyState
2019-03-08 14:52:33:  VERBOSE - rafcon.gui.models.abstract_state:  Observer already unregistered!
try to select Model of state: BarrierConcurrencyState with name 'State3' and id 'State3' [3 child states]
2019-03-08 14:52:35:    DEBUG - rafcon.tests.gui.widget.test_states_editor:  wait for state's state editor 0.10004935264587403
2019-03-08 14:52:35:    DEBUG - rafcon.gui.helpers.state_machine:  Change type of State 'State3' from BarrierConcurrencyState to HierarchyState
2019-03-08 14:52:35:     INFO - rafcon.gui.helpers.state:  Type change from BarrierConcurrencyState to HierarchyState
2019-03-08 14:52:35:  VERBOSE - rafcon.gui.models.abstract_state:  Observer already unregistered!
try to select Model of state: HierarchyState with name 'State3' and id 'State3' [2 child states]
2019-03-08 14:52:36:    DEBUG - rafcon.tests.gui.widget.test_states_editor:  wait for state's state editor 0.10004911422729493
2019-03-08 14:52:36:    DEBUG - rafcon.gui.helpers.state_machine:  Change type of State 'State3' from HierarchyState to PreemptiveConcurrencyState
2019-03-08 14:52:36:     INFO - rafcon.gui.helpers.state:  Type change from HierarchyState to PreemptiveConcurrencyState
2019-03-08 14:52:36:  VERBOSE - rafcon.gui.models.abstract_state:  Observer already unregistered!
try to select Model of state: PreemptiveConcurrencyState with name 'State3' and id 'State3' [2 child states]
2019-03-08 14:52:37:    DEBUG - rafcon.tests.gui.widget.test_states_editor:  wait for state's state editor 0.10007295608520508
2019-03-08 14:52:37:    DEBUG - rafcon.gui.helpers.state_machine:  Change type of State 'State3' from PreemptiveConcurrencyState to ExecutionState
2019-03-08 14:52:37:  VERBOSE - rafcon.gui.models.abstract_state:  Observer already unregistered!
try to select Model of state: ExecutionState with name 'State3' and id 'State3'
2019-03-08 14:52:38:    DEBUG - rafcon.tests.gui.widget.test_states_editor:  wait for state's state editor 0.10008749961853028
2019-03-08 14:52:38:    DEBUG - rafcon.gui.helpers.state_machine:  Change type of State 'Container' from HierarchyState to BarrierConcurrencyState
2019-03-08 14:52:38:     INFO - rafcon.gui.helpers.state:  Type change from HierarchyState to BarrierConcurrencyState
2019-03-08 14:52:38:  VERBOSE - rafcon.gui.models.abstract_state:  Observer already unregistered!
try to select Model of state: BarrierConcurrencyState with name 'Container' and id 'Root' [4 child states]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Stack of Thread-398 (140665761015552) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  File "/usr/lib/python3.5/threading.py", line 882, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/home/brunner/develop/RAFCON/tests/utils.py", line 322, in run_gui_thread
    start_gtk()
  File "/home/brunner/develop/RAFCON/source/rafcon/gui/start.py", line 203, in start_gtk
    Gtk.main()
  File "/usr/local/lib/python3.5/dist-packages/gi/overrides/Gtk.py", line 1641, in main
    return _Gtk_main(*args, **kwargs)
  File "/home/brunner/develop/RAFCON/source/rafcon/utils/log.py", line 143, in wrapper
    return function(*args, **kwargs)
  File "/home/brunner/develop/RAFCON/source/rafcon/utils/gui_functions.py", line 49, in fun
    result = callback(*args)
  File "/home/brunner/develop/RAFCON/tests/gui/widget/test_states_editor.py", line 165, in change_state_type
    get_state_editor_ctrl_and_store_id_dict(sm_m, state_m, main_window_controller, sleep_time_max, logger)
  File "/home/brunner/develop/RAFCON/tests/gui/widget/test_state_type_change.py", line 569, in get_state_editor_ctrl_and_store_id_dict
    [state_editor_ctrl, time_waited] = wait_for_states_editor(main_window_controller, state_identifier, sleep_time_max)
  File "/home/brunner/develop/RAFCON/tests/gui/widget/test_state_type_change.py", line 525, in wait_for_states_editor
    time.sleep(0.1)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Stack of MainThread (140666359576384) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  File "setup.py", line 143, in <module>
    zip_safe=True
  File "/home/brunner/develop/RAFCON/.tox/py35/lib/python3.5/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/brunner/develop/RAFCON/.eggs/pytest_runner-4.4-py3.5.egg/ptr.py", line 190, in run
    return self.run_tests()
  File "/home/brunner/develop/RAFCON/.eggs/pytest_runner-4.4-py3.5.egg/ptr.py", line 201, in run_tests
    result_code = __import__('pytest').main()
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/config/__init__.py", line 80, in main
    return config.hook.pytest_cmdline_main(config=config)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/manager.py", line 68, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/manager.py", line 62, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/usr/local/lib/python3.5/dist-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/main.py", line 243, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/main.py", line 210, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/main.py", line 250, in _main
    config.hook.pytest_runtestloop(session=session)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/manager.py", line 68, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/manager.py", line 62, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/usr/local/lib/python3.5/dist-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/main.py", line 271, in pytest_runtestloop
    item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/manager.py", line 68, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/manager.py", line 62, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/usr/local/lib/python3.5/dist-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/runner.py", line 78, in pytest_runtest_protocol
    runtestprotocol(item, nextitem=nextitem)
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/runner.py", line 93, in runtestprotocol
    reports.append(call_and_report(item, "call", log))
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/runner.py", line 173, in call_and_report
    call = call_runtest_hook(item, when, **kwds)
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/runner.py", line 198, in call_runtest_hook
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/runner.py", line 226, in from_call
    result = func()
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/runner.py", line 198, in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  File "/usr/local/lib/python3.5/dist-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/manager.py", line 68, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/manager.py", line 62, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/usr/local/lib/python3.5/dist-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/runner.py", line 123, in pytest_runtest_call
    item.runtest()
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/python.py", line 1456, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/manager.py", line 68, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pluggy/manager.py", line 62, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/usr/local/lib/python3.5/dist-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/brunner/.local/lib/python3.5/site-packages/_pytest/python.py", line 166, in pytest_pyfunc_call
    testfunction(**testargs)
  File "/home/brunner/develop/RAFCON/tests/gui/test__destruct.py", line 1219, in test_complex_model_and_core_destruct_with_gui
    gui_config={'AUTO_BACKUP_ENABLED': False, 'HISTORY_ENABLED': False})
  File "/home/brunner/develop/RAFCON/tests/gui/test__destruct.py", line 1242, in run_setup_gui_destruct
    func()
  File "/home/brunner/develop/RAFCON/tests/gui/test__destruct.py", line 533, in run_complex_controller_construction
    trigger_state_type_change_tests(with_gui=True)
  File "/home/brunner/develop/RAFCON/source/rafcon/utils/log.py", line 143, in wrapper
    return function(*args, **kwargs)
  File "/home/brunner/develop/RAFCON/tests/gui/widget/test_states_editor.py", line 203, in trigger_state_type_change_tests
    call_gui_callback(change_state_type, input_and_return_list, HierarchyState.__name__, state_of_type_change)
  File "/home/brunner/develop/RAFCON/tests/utils.py", line 110, in call_gui_callback
    return rafcon.utils.gui_functions.call_gui_callback(*((callback, ) + args), **kwargs)
  File "/home/brunner/develop/RAFCON/source/rafcon/utils/gui_functions.py", line 68, in call_gui_callback
    condition.wait()
  File "/usr/lib/python3.5/threading.py", line 293, in wait
    waiter.acquire()

Originally created by @sebastian-brunner ([email protected]) at 2019-03-08 13:55:40+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst

As it affects all python versions I added the unstable mark, see 6e6c3751e59ca7f852.

Originally created by @sebastian-brunner ([email protected]) at 2019-03-08 14:14:52+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst

A similar stacktrace can sometimes be observed for the test_state_type_change.py::test_state_type_change_test test as well, but very rarely. See: http://213.136.81.227:8080/job/rafcon_github/29/console

Originally created by @sebastian-brunner ([email protected]) at 2019-03-09 09:04:29+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst

Is this fixed with your wait_for_gui change?

Originally created by @franzlst ([email protected]) at 2019-08-06 12:11:35+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst