DeepSOIC / Part-o-magic

Experiment on FreeCAD-wide automation of Part container management. For FC v0.17-0.18
Other
12 stars 4 forks source link

Running Test Framework triggers a Part-o-Magic Error #31

Open luzpaz opened 5 years ago

luzpaz commented 5 years ago

Reproduce:

  1. Switch to 'Test framework' workbench
  2. Start Self-test
  3. Choose TestPathApp as the test name to run.
    Result:
    Traceback (most recent call last):
    File "/home/foo/.FreeCAD/Mod/Part-o-magic/PartOMagic/Gui/Utils.py", line 114, in timeout
    self.func()
    File "/home/foo/.FreeCAD/Mod/Part-o-magic/PartOMagic/Features/Ghost.py", line 174, in <lambda>
    oneshot = DelayedExecute((lambda doc = feature.Document: updateAllGhosts(doc)), delay= 100)
    File "/home/foo/.FreeCAD/Mod/Part-o-magic/PartOMagic/Features/Ghost.py", line 195, in updateAllGhosts
    for obj in doc.Objects:
    ReferenceError: Cannot access attribute 'Objects' of deleted object

    Another error:
    Error is triggered by TestPartDesignApp test. (Actually there a many duplicate errors when running this test.

    Traceback (most recent call last):
    File "/home/foo/.FreeCAD/Mod/Part-o-magic/PartOMagic/Gui/Observer.py", line 133, in slotChangedObject
    lmd()
    File "/home/foo/.FreeCAD/Mod/Part-o-magic/PartOMagic/Gui/Observer.py", line 116, in <lambda>
    self.appendToActiveContainer(feature, ac, aw)
    File "/home/foo/.FreeCAD/Mod/Part-o-magic/PartOMagic/Gui/Observer.py", line 329, in appendToActiveContainer
    if test_exclude(feature, active_workbench):
    File "/home/foo/.FreeCAD/Mod/Part-o-magic/PartOMagic/Gui/Observer.py", line 39, in test_exclude
    if feature.isDerivedFrom(typ):
    <class 'ReferenceError'>: Cannot access attribute 'isDerivedFrom' of deleted object

OS: Manjaro Linux (XFCE/xfce) Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.19.17068 (Git) AppImage Build type: Release Branch: master Hash: 236f890864ef51a8a09b7e507a3a122c41fbb724 Python version: 3.7.1 Qt version: 5.6.2 Coin version: 4.0.0a OCC version: 7.3.0 Locale: English/UnitedStates (en_US)

Running most up to date Part-o-Magic version

DeepSOIC commented 5 years ago

I know. Sorry, I probably can't fix it. I can only silence it.

luzpaz commented 5 years ago

@DeepSOIC Is it a time issue, or know-how? Why won't you fix it?

DeepSOIC commented 5 years ago

Well, if it is possible, it adds quite a lot of unnecessary complexity. Since it doesn't crash FreeCAD (as far as I know), it is not worth the trouble. I can "fix" it by just handling the error and thus silencing it, but that comes at a cost of potentially silencing the error for a case where it is a problem. Well, I'll think about it, maybe I will fix it after all...

That bug is caused by some delayed actions. E.g. this one appears to come from the mechanism for automatic tip advancement, where PoM waits for a little, to analyze the object when it's fully set up. In tests, the object just disappears too fast.