Fix non-deterministic test.

I hope.

Change-Id: I813fdeb9ecd2e6f64871bc9499b0d0919a9cea83
Reviewed-on: https://review.openstack.org/14171
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index 9b621c4..8ba6594 100644
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -1488,9 +1488,14 @@
         for x in jobs:
             print x
         # all jobs running
-        jobs[0].release()
-        jobs[1].release()
-        jobs[2].release()
+
+        # Grab pointers to the jobs we want to release before
+        # releasing any, because list indexes may change as
+        # the jobs complete.
+        a, b, c = jobs[:3]
+        a.release()
+        b.release()
+        c.release()
         self.waitUntilSettled()
 
         self.fake_jenkins.hold_jobs_in_build = False