unittest failures in arm64 and other arches

Bug #2046620 reported by Andreas Hasenack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
landscape-client (Ubuntu)
Fix Released
High
Mitch Burton

Bug Description

The 23.08-0ubuntu3 upload[1] of landscape-client is failing to build on armhf, arm64 and riscv64 due to unit test failures.

I reproduced the arm64 failures in a noble arm64 lxd:

[FAIL]
Traceback (most recent call last):
  File "/home/ubuntu/deb/landscape-client-23.08/landscape/client/monitor/tests/test_processorinfo.py", line 30, in test_read_proc_cpuinfo
    self.assertTrue(len(message["processors"]) > 0)
  File "/usr/lib/python3/dist-packages/twisted/trial/_synctest.py", line 380, in assertTrue
    super().assertTrue(condition, msg)
  File "/usr/lib/python3.11/unittest/case.py", line 715, in assertTrue
    raise self.failureException(msg)
twisted.trial.unittest.FailTest: False is not true

landscape.client.monitor.tests.test_processorinfo.ProcessorInfoTest.test_read_proc_cpuinfo
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/ubuntu/deb/landscape-client-23.08/landscape/client/monitor/tests/test_processorinfo.py", line 67, in test_resynchronize
    self.assertEqual(len(messages), 2)
  File "/usr/lib/python3/dist-packages/twisted/trial/_synctest.py", line 422, in assertEqual
    super().assertEqual(first, second, msg)
  File "/usr/lib/python3.11/unittest/case.py", line 873, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python3.11/unittest/case.py", line 866, in _baseAssertEqual
    raise self.failureException(msg)
twisted.trial.unittest.FailTest: 0 != 2

landscape.client.monitor.tests.test_processorinfo.ResynchTest.test_resynchronize
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/ubuntu/deb/landscape-client-23.08/landscape/client/monitor/tests/test_processorinfo.py", line 48, in test_call_on_accepted
    self.remote.send_message.assert_called_once_with(ANY, ANY, urgent=True)
  File "/usr/lib/python3.11/unittest/mock.py", line 950, in assert_called_once_with
    raise AssertionError(msg)
builtins.AssertionError: Expected 'mock' to be called once. Called 0 times.

landscape.client.monitor.tests.test_processorinfo.ProcessorInfoTest.test_call_on_accepted
-------------------------------------------------------------------------------
Ran 2339 tests in 415.794s

FAILED (skips=2, failures=2, errors=1, successes=2334)

1. https://launchpad.net/ubuntu/+source/landscape-client/23.08-0ubuntu3

Tags: ftbfs

Related branches

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

FWIW, this is /proc/cpuinfo on that arm64 system where I ran the test and it failed:
$ cat /proc/cpuinfo
processor : 0
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 1
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 2
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 3
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

Hardware : BCM2835
Revision : c03112
Serial : 10000000f40b82d7
Model : Raspberry Pi 4 Model B Rev 1.2

Changed in landscape-client (Ubuntu):
assignee: nobody → Mitch Burton (mitchburton)
Changed in landscape-client (Ubuntu):
status: New → Confirmed
Revision history for this message
Mitch Burton (mitchburton) wrote :

Issue appears to be that landscape.client.monitor.processorinfo.ARMMessageFactory is expecting a titlecase "Processor" rather than lowercase. There's some other issues here as well - the Factory doesn't expect a processor ID either. The above provided cpuinfo example seems more aligned with how X86MessageFactory processes cpuinfo files. I'm pretty sure the below comment:

# ARM doesn't support SMP, thus no processor-id in
# the cpuinfo

is outdated, so let's fix this so that it can handle actual processor IDs, at the very least.

Changed in landscape-client (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 23.08-0ubuntu4

---------------
landscape-client (23.08-0ubuntu4) noble; urgency=medium

  * d/p/0003-fix-cpuinfo-and-tests.patch: fix ARM and RISCV cpuinfo parsing;
    fix environment var-modifying tests, increase timeout on tests that can
    be slow on these arches (LP: #2046620).

 -- Mitch Burton <email address hidden> Thu, 04 Jan 2023 17:06:26 -0800

Changed in landscape-client (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.