Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pose3_TEST.py fails in arm64 6.9.0~pre1 #250

Closed
j-rivero opened this issue Sep 24, 2021 · 5 comments · Fixed by #257
Closed

Pose3_TEST.py fails in arm64 6.9.0~pre1 #250

j-rivero opened this issue Sep 24, 2021 · 5 comments · Fixed by #257
Labels
bug Something isn't working 🏯 fortress Ignition Fortress help wanted Extra attention is needed tests Broken or missing tests / testing infra

Comments

@j-rivero
Copy link
Contributor

Environment

  • OS Version: Ubuntu Focal, arm64
  • Source or binary build? during package creation

The debbuilder job from nightly today reports:

110/138 Test #110: Pose3_TEST.py ..........................***Failed    1.29 sec
......E
======================================================================
ERROR: test_stream_out (__main__.TestPose3)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/ign-math6-debbuilder/build/ign-math/src/python/Pose3_TEST.py", line 145, in test_stream_out
    self.assertAlmostEqual(str(p), "0.1 1.2 2.3 0 0.1 1")
  File "/usr/lib/python3.8/unittest/case.py", line 943, in assertAlmostEqual
    diff = abs(first - second)
TypeError: unsupported operand type(s) for -: 'str' and 'str'

----------------------------------------------------------------------
Ran 7 tests in 0.028s

FAILED (errors=1)

Seems to happen when "subtracting a string from another that contains numbers in both strings" which seems to me the thing what we are doing here. Why is not failing in other arches?

Description

  • Expected behavior: test to pass
  • Actual behavior: fails making the packaging job to fail
@j-rivero j-rivero added bug Something isn't working 🏯 fortress Ignition Fortress labels Sep 24, 2021
@chapulina chapulina added help wanted Extra attention is needed tests Broken or missing tests / testing infra labels Sep 27, 2021
@scpeters
Copy link
Member

I think the problem is that assertAlmostEqual is meant for numeric types, not string types. The method starts by comparing with == and returning quickly if they match exactly, which I believe is why it works in most cases:

https://github.com/python/cpython/blob/v3.8.12/Lib/unittest/case.py#L923-L939

my guess is that the pose strings don't match exactly on arm64, which is causing assertAlmostEqual to fail drastically

@scpeters
Copy link
Member

I've opened #255 to use assertEqual instead of assertAlmostEqual, which should improve the error message, but I still expect the test to fail.

@scpeters scpeters mentioned this issue Sep 30, 2021
7 tasks
@scpeters
Copy link
Member

scpeters commented Sep 30, 2021

trying an arm64 build of 6.9.1~pre1:

@scpeters
Copy link
Member

the test failure is more clear now:

110/138 Test #110: Pose3_TEST.py ..........................***Failed    0.10 sec
......F
======================================================================
FAIL: test_stream_out (__main__.TestPose3)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jenkins/workspace/ign-math6-debbuilder/build/ignition-math-6.9.1~pre1/src/python/Pose3_TEST.py", line 145, in test_stream_out
    self.assertEqual(str(p), "0.1 1.2 2.3 0 0.1 1")
AssertionError: '0.1 1.2 2.3 -0 0.1 1' != '0.1 1.2 2.3 0 0.1 1'
- 0.1 1.2 2.3 -0 0.1 1
?             -
+ 0.1 1.2 2.3 0 0.1 1


----------------------------------------------------------------------
Ran 7 tests in 0.001s

FAILED (failures=1)

scpeters added a commit to scpeters/ign-math that referenced this issue Sep 30, 2021
@scpeters
Copy link
Member

potential fix in #257

scpeters added a commit that referenced this issue Sep 30, 2021
* Pose3_TEST.py: use 0.01 (not 0) in string test

Fixes #250.

Signed-off-by: Steve Peters <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🏯 fortress Ignition Fortress help wanted Extra attention is needed tests Broken or missing tests / testing infra
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants