Bug #7468 - Test PathTests.TestPathDrillable.TestPathDrillable fails on s390x

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
coldtobi
Posts: 3
Joined: Fri Sep 09, 2022 1:11 pm

Bug #7468 - Test PathTests.TestPathDrillable.TestPathDrillable fails on s390x

Post by coldtobi »

Hi,

I'm one of the people looking after FreeCAD in Debian, I've encountered a test suite error in the TestPathDrillable testsuite on the s390x Architecture.
The other architectures seems to be fine, so I'm quite puzzled about the reason behind.

s390x is for Debian a release architecture, so this failure currently prevents freecad to migrate to "testing", the staging area for the next release of Debian.

The failure happens on the Debian CI, the full log for (the failing) s390x can be found here: https://ci.debian.net/data/autopkgtest/ ... 237/log.gz, here the excerpt of the failing test:

Code: Select all

======================================================================
FAIL: test10 (PathTests.TestPathDrillable.TestPathDrillable)
Test isDrillable
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/share/freecad/Mod/Path/PathTests/TestPathDrillable.py", line 78, in test10
    self.assertTrue(drillableLib.isDrillable(self.obj.Shape, candidate))
AssertionError: False is not true

======================================================================
FAIL: test20 (PathTests.TestPathDrillable.TestPathDrillable)
Test getDrillableTargets
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/share/freecad/Mod/Path/PathTests/TestPathDrillable.py", line 305, in test20
    self.assertEqual(len(results), 20)
AssertionError: 21 != 20

----------------------------------------------------------------------
Ran 736 tests in 46.072s

FAILED (failures=2)
As said, I have no idea where to start looking to pin point the problem, let me know if I can somehow provide more information.
Last edited by Kunda1 on Sat Oct 15, 2022 11:29 pm, edited 1 time in total.
Reason: Added GH ticket number to thread title
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Test PathTests.TestPathDrillable.TestPathDrillable fails on s390x

Post by Kunda1 »

What revision are you pulling (HEAD ?)
Is there a list of dependencies you can post ?

Code: Select all

freecad --version --verbose
or paste the About info
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Test PathTests.TestPathDrillable.TestPathDrillable fails on s390x

Post by sliptonic »

coldtobi wrote: Fri Sep 09, 2022 2:05 pm Hi,

I'm one of the people looking after FreeCAD in Debian, I've encountered a test suite error in the TestPathDrillable testsuite on the s390x Architecture.
The other architectures seems to be fine, so I'm quite puzzled about the reason behind.

s390x is for Debian a release architecture, so this failure currently prevents freecad to migrate to "testing", the staging area for the next release of Debian.
Thanks for working on this.

The unittest is testing the functionality of the drillablelib module. Basically there's a function that finds holes in a shape that can be drilled on a CNC machine. It also can evaluate a single candidate hole.
Drillable in this context means that the hole is cylindrical and aligned with the Z axis.

It first loads the test file (/Mod/Path/PathTests/Drilling_1.FCStd in the install directory)
This particular test is evaluating the cylindrical wall shown below which is definitely drillable. For some reason, it's reporting as not drillable on that architecture.
2022-09-09_14-45.png
2022-09-09_14-45.png (22.46 KiB) Viewed 1110 times
There's somethings you can do to get more info.

Edit the File /Mod/Path/PathScripts/drillableLib.py
set line 7 to True and rerun the test. The PathLog statements should tell us which of the attributes is failing.

You can run just this one test from the command line like this

Code: Select all

FreeCADCmd -t TestPathApp.TestPathDrillable.test10

You can also start FreeCAD and open the test file. Then run this macro

Code: Select all

from PathScripts import drillableLib as dl
from importlib import reload
reload(dl)

obj = doc.getObject("Body")
s = obj.getSubObject("Face30")

if dl.isDrillable(obj.Shape, s):
    print("drillable")
else:
    print("not drillable")   
   
vm4dim
Posts: 129
Joined: Tue Nov 23, 2021 1:05 am

Re: Test PathTests.TestPathDrillable.TestPathDrillable fails on s390x

Post by vm4dim »

Which is correct 20 or 21?
I'm confused. :shock:
User avatar
mfro
Posts: 663
Joined: Sat Sep 23, 2017 8:15 am

Re: Test PathTests.TestPathDrillable.TestPathDrillable fails on s390x

Post by mfro »

Although off-topic, I would be eager to know if there is anybody using FreeCAD on an s390/System Z?
Cheers,
Markus
coldtobi
Posts: 3
Joined: Fri Sep 09, 2022 1:11 pm

Re: Test PathTests.TestPathDrillable.TestPathDrillable fails on s390x

Post by coldtobi »

Kunda1 wrote: Fri Sep 09, 2022 5:33 pm What revision are you pulling (HEAD ?)
Is there a list of dependencies you can post ?

Code: Select all

freecad --version --verbose
or paste the About info

Code: Select all

FreeCAD 0.20.1 Revision: 

Library versions:
boost    1_74
Coin3D   4.0.0
Eigen3   3.4.0
OCC      7.6.3
Qt       5.15.4
Python   3.10.7
PySide   5.15.2
shiboken 5.15.2
VTK      9.1.0
xerces-c 3.2.3
coldtobi wrote: Fri Sep 09, 2022 2:05 pm
It first loads the test file (/Mod/Path/PathTests/Drilling_1.FCStd in the install directory)
Many thanks for the hints/instructions!

I've tried to load that file on the s390x porterbox I have access to, /running FreeCAD
in a VNC server), and it does not load the file: Freecad runs out of memory while and gets killed
by the OOM killwe while trying to load the file (the porter box has 4GiB RAM/4GiB Swap configures)
sliptonic wrote: Fri Sep 09, 2022 8:10 pm There's somethings you can do to get more info.

Edit the File /Mod/Path/PathScripts/drillableLib.py
set line 7 to True and rerun the test. The PathLog statements should tell us which of the attributes is failing.

You can run just this one test from the command line like this

Code: Select all

FreeCADCmd -t TestPathApp.TestPathDrillable.test10
Here's the output: (I've snipped the "progress indicator" when loading to keep it brief, marked with "(…)"
The command issues was:

Code: Select all

FreeCADCmd -t TestPathApp.TestPathDrillable.test10 >~/test10.log 2>&1

Code: Select all

test10 (PathTests.TestPathDrillable.TestPathDrillable)
Test isDrillable ... FAIL

======================================================================
FAIL: test10 (PathTests.TestPathDrillable.TestPathDrillable)
Test isDrillable
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tobi/freecad_sid_s390x/freecad-0.20.1+dfsg1/debian/build-py3/Mod/Path/PathTests/TestPathDrillable.py", line 78, in test10
    self.assertTrue(drillableLib.isDrillable(self.obj.Shape, candidate))
AssertionError: False is not true

----------------------------------------------------------------------
Ran 1 test in 0.125s

FAILED (failures=1)
FreeCAD 0.20.1, Libs: 0.20.1R
(c) Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2022
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Importing project files......
(...)
						(100 %)	

Postprocessing......
(...)
						(100 %)	

drillableLib.DEBUG: (223) - obj: <Solid object at 0x2aa2f126190> candidate: <Vertex object at 0x2aa2f11b800> tooldiameter None vector Vector (0.0, 0.0, 1.0)
drillableLib.DEBUG: (223) - obj: <Solid object at 0x2aa2f11b800> candidate: <Face object at 0x2aa2f126190> tooldiameter None vector Vector (0.0, 0.0, 1.0)
drillableLib.DEBUG: (50) - 
 match tool diameter False 
 match vector True
drillableLib(105).isDrillableCylinder(candidate is a blind hole)
drillableLib.DEBUG: (264) - vector angle: 180.0
drillableLib(111).isDrillableCylinder(False)

tobi
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Test PathTests.TestPathDrillable.TestPathDrillable fails on s390x

Post by sliptonic »

Very strange.
First, it's detecting that the hole is blind. It's not. I'm seeing this on my machine also and I don't think it's the problem.

It's failing because the hole 'direction' is wrong.

On my machine, it's detecting the angle of the hole is 0.0 degrees so it's drillable from the top, even if it's blind.

Your trace shows that it's detecting the hole as 180 degrees so not drillable. I don't understand.

There are significant differences between versions. Notably Python and OCC. If I had to venture a guess, I'd say it's OCC related. I'll try to investigate further.

Code: Select all

OS: Linux Mint 20 (i3/i3)
Word size of FreeCAD: 64-bit
Version: 0.21.30345 (Git)
Build type: Unknown
Branch: master
Hash: f42a47aa0fd8c4f34ef63c185d9f29b9b6e84737
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.2
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.12.3
  * Behave-Dark-Colors 0.1.1
  * 3DfindIT 1.2.0
  * ProDarkThemePreferencePack 1.0.0
  * sheetmetal 0.2.52
  * FeedsAndSpeeds
  * ExtremeProDark 1.0.4
  * FeedsAndSpeeds.bak
  * Dracula 0.0.2
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Test PathTests.TestPathDrillable.TestPathDrillable fails on s390x

Post by sliptonic »

Forget the blind-hole thing. That's a red-herring. Just a misplaced debug statement which I'll fix
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug #7468 - Test PathTests.TestPathDrillable.TestPathDrillable fails on s390x

Post by Kunda1 »

Op opened issue #7468
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply