handle start build failure in test
@@ -74,10 +74,14 @@ var _ = g.Describe("[Feature:Builds][pruning] prune builds based on settings in
g.By("starting four test builds")
done := make(chan struct{})
+ buildResults := [4]*exutil.BuildResult{}
for i := 0; i < 4; i++ {
go func() {
- br, _ := exutil.StartBuildAndWait(oc, "myphp")
- br.AssertSuccess()
+ count := i
+ var err error
+ buildResults[count], err = exutil.StartBuildAndWait(oc, "myphp")
+ o.Expect(err).NotTo(o.HaveOccurred())
+ o.Expect(buildResults[count]).NotTo(o.BeNil())
done <- struct{}{}
}()
// avoid conflicts that may occur when launching multiple builds in parallel.
@@ -86,6 +90,9 @@ var _ = g.Describe("[Feature:Builds][pruning] prune builds based on settings in
for i := 0; i < 4; i++ {
<-done
}
+ for i := 0; i < 4; i++ {
+ buildResults[i].AssertSuccess()
+ }
buildConfig, err := oc.BuildClient().Build().BuildConfigs(oc.Namespace()).Get("myphp", metav1.GetOptions{})
if err != nil {
@@ -128,10 +135,14 @@ var _ = g.Describe("[Feature:Builds][pruning] prune builds based on settings in
g.By("starting four test builds")
done := make(chan struct{})
+ buildResults := [4]*exutil.BuildResult{}
for i := 0; i < 4; i++ {
go func() {
- br, _ := exutil.StartBuildAndWait(oc, "myphp")
- br.AssertFailure()
+ count := i
+ var err error
+ buildResults[count], err = exutil.StartBuildAndWait(oc, "myphp")
+ o.Expect(err).NotTo(o.HaveOccurred())
+ o.Expect(buildResults[count]).NotTo(o.BeNil())
done <- struct{}{}
}()
// avoid conflicts that may occur when launching multiple builds in parallel.
@@ -140,6 +151,9 @@ var _ = g.Describe("[Feature:Builds][pruning] prune builds based on settings in
for i := 0; i < 4; i++ {
<-done
}
+ for i := 0; i < 4; i++ {
+ buildResults[i].AssertFailure()
+ }
buildConfig, err := oc.BuildClient().Build().BuildConfigs(oc.Namespace()).Get("myphp", metav1.GetOptions{})
if err != nil {
@@ -227,10 +241,14 @@ var _ = g.Describe("[Feature:Builds][pruning] prune builds based on settings in
g.By("starting four test builds")
done := make(chan struct{})
+ buildResults := [4]*exutil.BuildResult{}
for i := 0; i < 4; i++ {
go func() {
- br, _ := exutil.StartBuildAndWait(oc, "myphp")
- br.AssertFailure()
+ count := i
+ var err error
+ buildResults[count], err = exutil.StartBuildAndWait(oc, "myphp")
+ o.Expect(err).NotTo(o.HaveOccurred())
+ o.Expect(buildResults[count]).NotTo(o.BeNil())
done <- struct{}{}
}()
// avoid conflicts that may occur when launching multiple builds in parallel.
@@ -239,6 +257,9 @@ var _ = g.Describe("[Feature:Builds][pruning] prune builds based on settings in
for i := 0; i < 4; i++ {
<-done
}
+ for i := 0; i < 4; i++ {
+ buildResults[i].AssertFailure()
+ }
buildConfig, err := oc.BuildClient().Build().BuildConfigs(oc.Namespace()).Get("myphp", metav1.GetOptions{})
if err != nil {
