← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Gary Poster has proposed merging lp:~gary/launchpad/bug988541 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #988541 in Launchpad itself: "Intermittent error in lp.soyuz.tests.test_packagecloner.PackageClonerTests.testPackageSetDiffWithChangedPackages"
  https://bugs.launchpad.net/launchpad/+bug/988541

For more details, see:
https://code.launchpad.net/~gary/launchpad/bug988541/+merge/103778

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.
-- 
https://code.launchpad.net/~gary/launchpad/bug988541/+merge/103778
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~gary/launchpad/bug988541 into lp:launchpad.
=== modified file 'lib/lp/soyuz/tests/test_packagecloner.py'
--- lib/lp/soyuz/tests/test_packagecloner.py	2012-01-01 02:58:52 +0000
+++ lib/lp/soyuz/tests/test_packagecloner.py	2012-04-26 21:16:21 +0000
@@ -434,8 +434,9 @@
             return tuples
         actual_changed_tuples = get_tuples(actual_changed_keys)
         actual_new_tuples = get_tuples(actual_new_keys)
-        self.assertEqual(expected_changed_tuples, actual_changed_tuples)
-        self.assertEqual(expected_new_tuples, actual_new_tuples)
+        self.assertEqual(
+            set(expected_changed_tuples), set(actual_changed_tuples))
+        self.assertEqual(set(expected_new_tuples), set(actual_new_tuples))
 
     def testPackageSetDiffWithNothingNew(self):
         """Test packageSetDiff."""


Follow ups