← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~mbp/launchpad/882324-mtime-test into lp:launchpad

 

Martin Pool has proposed merging lp:~mbp/launchpad/882324-mtime-test into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #882324 in Launchpad itself: "test failure in testHomeDirectoryJob"
  https://bugs.launchpad.net/launchpad/+bug/882324

For more details, see:
https://code.launchpad.net/~mbp/launchpad/882324-mtime-test/+merge/80521

This tries to make the spurious test failure in bug 882324 either not happen, or at least fail in a more obvious way.

I can't reproduce it locally after several tries so I'm not sure this fixes it.
-- 
https://code.launchpad.net/~mbp/launchpad/882324-mtime-test/+merge/80521
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~mbp/launchpad/882324-mtime-test into lp:launchpad.
=== modified file 'lib/canonical/launchpad/utilities/ftests/test_gpghandler.py'
--- lib/canonical/launchpad/utilities/ftests/test_gpghandler.py	2011-08-28 07:29:11 +0000
+++ lib/canonical/launchpad/utilities/ftests/test_gpghandler.py	2011-10-27 00:32:24 +0000
@@ -170,7 +170,11 @@
         now = floor(time())
         gpghandler.touchConfigurationDirectory()
         for fname in files_to_check:
-            self.assertTrue(now <= floor(os.path.getmtime(fname)))
+            file_time = os.path.getmtime(fname)
+            self.assertTrue(
+                now <= file_time,
+                'file %r expected to change no later than %r actually %r'
+                % (fname, now, file_time))
 
     def test_retrieveKey_raises_GPGKeyDoesNotExistOnServer(self):
         # GPGHandler.retrieveKey() raises GPGKeyDoesNotExistOnServer