Fix test race condition.

The fake jenkins queue may have been modified during the call to
get_queue_info, so operate on a copy of the queue (which is more
like reality than locking the queue because we get a copy of the
queue from the jenkins api).

Also, fix a string formatting error which for some reason was
not raising an exception until we tried running the tests on
quantal.

Change-Id: I51e588fb147515c826395439516cf843c2da83f3
Reviewed-on: https://review.openstack.org/23781
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index 182aaca..8c7b211 100644
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -575,7 +575,9 @@
 
     def get_queue_info(self):
         items = []
-        for job in self.queue:
+        for job in self.queue[:]:
+            self.log.debug("Queue info: %s %s" % (job.name,
+                                                  job.parameters['UUID']))
             paramstr = ''
             paramlst = []
             d = {'actions': [{'parameters': paramlst},
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index 38fd9fb..0c9ae2a 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -622,7 +622,7 @@
             return False
 
         if not self.enqueueChangesAhead(change):
-            self.log.debug("Failed to enqueue changes ahead of" % change)
+            self.log.debug("Failed to enqueue changes ahead of %s" % change)
             return False
 
         if self.isChangeAlreadyInQueue(change):