@@ -27,6 +27,7 @@ var _ = g.Describe("[Feature:Builds][Slow] update failure status", func() {
2727 fetchDockerSrc = exutil .FixturePath ("testdata" , "builds" , "statusfail-fetchsourcedocker.yaml" )
2828 fetchS2ISrc = exutil .FixturePath ("testdata" , "builds" , "statusfail-fetchsources2i.yaml" )
2929 badContextDirS2ISrc = exutil .FixturePath ("testdata" , "builds" , "statusfail-badcontextdirs2i.yaml" )
30+ oomkilled = exutil .FixturePath ("testdata" , "builds" , "statusfail-oomkilled.yaml" )
3031 builderImageFixture = exutil .FixturePath ("testdata" , "builds" , "statusfail-fetchbuilderimage.yaml" )
3132 pushToRegistryFixture = exutil .FixturePath ("testdata" , "builds" , "statusfail-pushtoregistry.yaml" )
3233 failedAssembleFixture = exutil .FixturePath ("testdata" , "builds" , "statusfail-failedassemble.yaml" )
@@ -130,6 +131,32 @@ var _ = g.Describe("[Feature:Builds][Slow] update failure status", func() {
130131 })
131132 })
132133
134+ g .Describe ("Build status OutOfMemoryKilled" , func () {
135+ g .It ("should contain OutOfMemoryKilled failure reason and message" , func () {
136+ err := oc .Run ("create" ).Args ("-f" , oomkilled ).Execute ()
137+ o .Expect (err ).NotTo (o .HaveOccurred ())
138+
139+ br , err := exutil .StartBuildAndWait (oc , "statusfail-oomkilled" , "--build-loglevel=5" )
140+ o .Expect (err ).NotTo (o .HaveOccurred ())
141+ br .AssertFailure ()
142+ br .DumpLogs ()
143+
144+ var build * buildapi.Build
145+ wait .PollImmediate (200 * time .Millisecond , 30 * time .Second , func () (bool , error ) {
146+ build , err = oc .BuildClient ().Build ().Builds (oc .Namespace ()).Get (br .Build .Name , metav1.GetOptions {})
147+ if build .Status .Reason != buildapi .StatusReasonOutOfMemoryKilled {
148+ return false , nil
149+ }
150+ return true , nil
151+ })
152+ o .Expect (err ).NotTo (o .HaveOccurred ())
153+ o .Expect (build .Status .Reason ).To (o .Equal (buildapi .StatusReasonOutOfMemoryKilled ))
154+ o .Expect (build .Status .Message ).To (o .Equal (buildapi .StatusMessageOutOfMemoryKilled ))
155+
156+ exutil .CheckForBuildEvent (oc .KubeClient ().Core (), br .Build , buildapi .BuildFailedEventReason , buildapi .BuildFailedEventMessage )
157+ })
158+ })
159+
133160 g .Describe ("Build status S2I bad context dir failure" , func () {
134161 g .It ("should contain the S2I bad context dir failure reason and message" , func () {
135162 err := oc .Run ("create" ).Args ("-f" , badContextDirS2ISrc ).Execute ()
0 commit comments