Merge ~seyeongkim/maas:2.9-raid2 into maas:2.9

Proposed by Seyeong Kim
Status: Merged
Approved by: Alberto Donato
Approved revision: 817996481748e2ed685e481f22ef209904b7fcd4
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~seyeongkim/maas:2.9-raid2
Merge into: maas:2.9
Diff against target: 17 lines (+5/-1)
1 file modified
src/maasserver/models/tests/test_filesystem.py (+5/-1)
Reviewer Review Type Date Requested Status
Alberto Donato (community) Approve
MAAS Lander Approve
Review via email: mp+429339@code.launchpad.net

Commit message

Two flaky tests fixes.

When put in a RAID, the minimum partition size becomes too small due
to RAID overhead: ensure we're not picking the minimum size.

Ensure that no generated NodeDevices clash with test fixtures - testing that filters work wasn't taking in to account potential clash with factory-generated NodeDevices.

(cherry picked from commit b359717e2775279651776fa90d07fb08cea5e4fd)

To post a comment you must log in.
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b 2.9-raid2 lp:~seyeongkim/maas/+git/maas into -b 2.9 lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 817996481748e2ed685e481f22ef209904b7fcd4

review: Approve
Revision history for this message
Seyeong Kim (seyeongkim) wrote :

Please review this cherry pick if this solves below test fault.

[2022-08-31T04:16:10.690Z] metadataserver.tests.test_api_twisted.TestStatusHandlerResource.test_render_POST_empty_authorization ... ok
[2022-08-31T04:16:10.690Z]
[2022-08-31T04:16:10.690Z] ======================================================================
[2022-08-31T04:16:10.690Z] FAIL: maasserver.models.tests.test_filesystem.TestFilesystem.test_get_physical_block_device_raid_on_part
[2022-08-31T04:16:10.690Z] maasserver.models.tests.test_filesystem.TestFilesystem.test_get_physical_block_device_raid_on_part
[2022-08-31T04:16:10.690Z] ----------------------------------------------------------------------
[2022-08-31T04:16:10.690Z] testtools.testresult.real._StringException: Traceback (most recent call last):
[2022-08-31T04:16:10.690Z] testtools.testresult.real._StringException: Empty attachments:
[2022-08-31T04:16:10.690Z] Twisted logs
[2022-08-31T04:16:10.690Z]
[2022-08-31T04:16:10.690Z] Traceback (most recent call last):
[2022-08-31T04:16:10.690Z] File "/run/build/checkout/src/maastesting/runtest.py", line 125, in _run_user
[2022-08-31T04:16:10.690Z] result = function(*args, **kwargs)
[2022-08-31T04:16:10.690Z] File "/run/build/checkout/.ve/lib/python3.8/site-packages/testtools/testcase.py", line 719, in _run_test_method
[2022-08-31T04:16:10.690Z] return self._get_test_method()()
[2022-08-31T04:16:10.690Z] File "/run/build/checkout/src/maasserver/models/tests/test_filesystem.py", line 124, in test_get_physical_block_device_raid_on_part
[2022-08-31T04:16:10.690Z] fs_group = RAID.objects.create_raid(
[2022-08-31T04:16:10.690Z] File "/run/build/checkout/src/maasserver/models/filesystemgroup.py", line 223, in create_raid
[2022-08-31T04:16:10.690Z] raid.save(force_update=True)
[2022-08-31T04:16:10.690Z] File "/run/build/checkout/src/maasserver/models/filesystemgroup.py", line 755, in save
[2022-08-31T04:16:10.690Z] VirtualBlockDevice.objects.create_or_update_for(self)
[2022-08-31T04:16:10.690Z] File "/run/build/checkout/src/maasserver/models/virtualblockdevice.py", line 54, in create_or_update_for
[2022-08-31T04:16:10.690Z] block_device.save()
[2022-08-31T04:16:10.690Z] File "/run/build/checkout/src/maasserver/models/virtualblockdevice.py", line 133, in save
[2022-08-31T04:16:10.690Z] return super().save(*args, **kwargs)
[2022-08-31T04:16:10.690Z] File "/run/build/checkout/src/maasserver/models/cleansave.py", line 183, in save
[2022-08-31T04:16:10.690Z] self.full_clean(
[2022-08-31T04:16:10.690Z] File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 1203, in full_clean
[2022-08-31T04:16:10.690Z] raise ValidationError(errors)
[2022-08-31T04:16:10.690Z] django.core.exceptions.ValidationError: {'size': ['Ensure this value is greater than or equal to 4194304.']}
[2022-08-31T04:16:10.690Z]
[2022-08-31T04:16:10.690Z]
[2022-08-31T04:16:10.690Z] ----------------------------------------------------------------------

Revision history for this message
Alberto Donato (ack) wrote :

+1

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNABLE TO START LANDING

STATUS: MISSING COMMIT MESSAGE

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/models/tests/test_filesystem.py b/src/maasserver/models/tests/test_filesystem.py
2index a76ea62..871a10d 100644
3--- a/src/maasserver/models/tests/test_filesystem.py
4+++ b/src/maasserver/models/tests/test_filesystem.py
5@@ -120,7 +120,11 @@ class TestFilesystem(MAASServerTestCase):
6 block_device = factory.make_PhysicalBlockDevice(node=node)
7 block_devices.append(block_device)
8 pt = factory.make_PartitionTable(block_device=block_device)
9- partitions.append(factory.make_Partition(partition_table=pt))
10+ partitions.append(
11+ factory.make_Partition(
12+ partition_table=pt, size=pt.get_available_size()
13+ )
14+ )
15 fs_group = RAID.objects.create_raid(
16 level=FILESYSTEM_GROUP_TYPE.RAID_1, partitions=partitions
17 )

Subscribers

People subscribed via source and target branches