Merge lp:~rvb/maas/fix-spurious-test-failure into lp:~maas-committers/maas/trunk

Proposed by Raphaël Badin
Status: Merged
Approved by: Raphaël Badin
Approved revision: no longer in the source branch.
Merged at revision: 4130
Proposed branch: lp:~rvb/maas/fix-spurious-test-failure
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 15 lines (+3/-2)
1 file modified
src/maasserver/models/tests/test_node.py (+3/-2)
To merge this branch: bzr merge lp:~rvb/maas/fix-spurious-test-failure
Reviewer Review Type Date Requested Status
Mike Pontillo (community) Approve
Review via email: mp+265634@code.launchpad.net

Commit message

Fix spurious test failure: explicitly sort the MACs in the tests.

Description of the change

Note that I haven't been able to reproduce the spurious failure that happened when landing a branch but I figured the sorting needed to be explicit for the first node to get picked up correctly.

To post a comment you must log in.
Revision history for this message
Mike Pontillo (mpontillo) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/maasserver/models/tests/test_node.py'
--- src/maasserver/models/tests/test_node.py 2015-07-21 21:14:48 +0000
+++ src/maasserver/models/tests/test_node.py 2015-07-23 10:50:51 +0000
@@ -2059,8 +2059,9 @@
20592059
2060 def test_get_pxe_mac_returns_first_macaddress_if_pxe_mac_unset(self):2060 def test_get_pxe_mac_returns_first_macaddress_if_pxe_mac_unset(self):
2061 node = factory.make_Node(mac=True)2061 node = factory.make_Node(mac=True)
2062 factory.make_MACAddress(node=node)2062 [factory.make_MACAddress(node=node) for _ in range(3)]
2063 self.assertEqual(node.macaddress_set.first(), node.get_pxe_mac())2063 self.assertEqual(
2064 node.macaddress_set.order_by('id').first(), node.get_pxe_mac())
20642065
2065 def test_pxe_mac_deletion_does_not_delete_node(self):2066 def test_pxe_mac_deletion_does_not_delete_node(self):
2066 node = factory.make_Node(mac=True)2067 node = factory.make_Node(mac=True)