| ... | ... |
@@ -646,18 +646,33 @@ func runBuildRunningPodDeleteTest(t *testing.T, clusterAdminClient *client.Clien |
| 646 | 646 |
t.Fatalf("expected watch event type %s, got %s", e, a)
|
| 647 | 647 |
} |
| 648 | 648 |
newBuild := event.Object.(*buildapi.Build) |
| 649 |
+ buildName := newBuild.Name |
|
| 650 |
+ podName := newBuild.Name + "-build" |
|
| 649 | 651 |
|
| 650 | 652 |
// initial pod creation for build |
| 651 |
- event = waitForWatch(t, "build pod created", podWatch) |
|
| 653 |
+ for {
|
|
| 654 |
+ event = waitForWatch(t, "build pod created", podWatch) |
|
| 655 |
+ newPod := event.Object.(*kapi.Pod) |
|
| 656 |
+ if newPod.Name == podName {
|
|
| 657 |
+ break |
|
| 658 |
+ } |
|
| 659 |
+ } |
|
| 652 | 660 |
if e, a := watchapi.Added, event.Type; e != a {
|
| 653 | 661 |
t.Fatalf("expected watch event type %s, got %s", e, a)
|
| 654 | 662 |
} |
| 655 | 663 |
|
| 656 |
- event = waitForWatch(t, "build updated to pending", buildWatch) |
|
| 664 |
+ // throw away events from other builds, we only care about the new build |
|
| 665 |
+ // we just triggered |
|
| 666 |
+ for {
|
|
| 667 |
+ event = waitForWatch(t, "build updated to pending", buildWatch) |
|
| 668 |
+ newBuild = event.Object.(*buildapi.Build) |
|
| 669 |
+ if newBuild.Name == buildName {
|
|
| 670 |
+ break |
|
| 671 |
+ } |
|
| 672 |
+ } |
|
| 657 | 673 |
if e, a := watchapi.Modified, event.Type; e != a {
|
| 658 | 674 |
t.Fatalf("expected watch event type %s, got %s", e, a)
|
| 659 | 675 |
} |
| 660 |
- newBuild = event.Object.(*buildapi.Build) |
|
| 661 | 676 |
if newBuild.Status.Phase != buildapi.BuildPhasePending {
|
| 662 | 677 |
t.Fatalf("expected build status to be marked pending, but was marked %s", newBuild.Status.Phase)
|
| 663 | 678 |
} |