Merge "Fix race condition in test_success_url" into feature/zuulv3
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index 35b741d..d4fd1d8 100755
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -4640,7 +4640,10 @@
         self.assertEqual(len(self.history), 2)
 
         # Grab build id
-        uuid = self.history[0].uuid[:7]
+        for build in self.history:
+            if build.name == 'docs-draft-test':
+                uuid = build.uuid[:7]
+                break
 
         # Two msgs: 'Starting...'  + results
         self.assertEqual(len(self.smtp_messages), 2)