Merge lp:~gary/launchpad/bug988541 into lp:launchpad

Proposed by Gary Poster on 2012-04-26
Status: Merged
Approved by: Brad Crittenden on 2012-04-26
Approved revision: no longer in the source branch.
Merged at revision: 15163
Proposed branch: lp:~gary/launchpad/bug988541
Merge into: lp:launchpad
Diff against target: 14 lines (+2/-2)
1 file modified
lib/lp/soyuz/tests/test_packagecloner.py (+2/-2)
To merge this branch: bzr merge lp:~gary/launchpad/bug988541
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code 2012-04-26 Approve on 2012-04-26
Review via email: mp+103778@code.launchpad.net

Commit Message

Make some tests less likely to fail intermittently because of ordering issues.

Description of the Change

This is a simple change to make tests better handle ordering issues, which show up intermittently (see bug 988541). AFAICT the order is not important, so I changed the comparison to sets. Subsequently these tests pass reliably.

To post a comment you must log in.
Brad Crittenden (bac) wrote :

Changing to not care about ordering looks reasonable to me, Gary.

As discussed on IRC I think assertContentEqual would do an unordered comparison.

review: Approve (code)
Gary Poster (gary) wrote :

Cool, makes sense. Changed. Thank you!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/tests/test_packagecloner.py'
2--- lib/lp/soyuz/tests/test_packagecloner.py 2012-01-01 02:58:52 +0000
3+++ lib/lp/soyuz/tests/test_packagecloner.py 2012-04-26 21:27:30 +0000
4@@ -434,8 +434,8 @@
5 return tuples
6 actual_changed_tuples = get_tuples(actual_changed_keys)
7 actual_new_tuples = get_tuples(actual_new_keys)
8- self.assertEqual(expected_changed_tuples, actual_changed_tuples)
9- self.assertEqual(expected_new_tuples, actual_new_tuples)
10+ self.assertContentEqual(expected_changed_tuples, actual_changed_tuples)
11+ self.assertContentEqual(expected_new_tuples, actual_new_tuples)
12
13 def testPackageSetDiffWithNothingNew(self):
14 """Test packageSetDiff."""