Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: milo/appengine/swarming/build.go

Issue 2254993002: Milo: Add task expired as a failure status (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: Retrain, remove build-hang test case Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package swarming 5 package swarming
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "encoding/json" 9 "encoding/json"
10 "fmt" 10 "fmt"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 switch sr.State { 276 switch sr.State {
277 case TaskRunning: 277 case TaskRunning:
278 step.Status = miloProto.Status_RUNNING 278 step.Status = miloProto.Status_RUNNING
279 279
280 case TaskPending: 280 case TaskPending:
281 step.Status = miloProto.Status_PENDING 281 step.Status = miloProto.Status_PENDING
282 282
283 case TaskExpired, TaskTimedOut, TaskBotDied: 283 case TaskExpired, TaskTimedOut, TaskBotDied:
284 step.Status = miloProto.Status_FAILURE 284 step.Status = miloProto.Status_FAILURE
285 step.FailureDetails = &miloProto.FailureDetails{
286 Type: miloProto.FailureDetails_INFRA,
287 }
288 285
289 switch sr.State { 286 switch sr.State {
290 case TaskExpired: 287 case TaskExpired:
291 » » » step.FailureDetails.Text = "Task expired" 288 » » » step.FailureDetails = &miloProto.FailureDetails{
289 » » » » Type: miloProto.FailureDetails_EXPIRED,
290 » » » » Text: "Task expired",
291 » » » }
292 case TaskTimedOut: 292 case TaskTimedOut:
293 » » » step.FailureDetails.Text = "Task timed out" 293 » » » step.FailureDetails = &miloProto.FailureDetails{
294 » » » » Type: miloProto.FailureDetails_INFRA,
295 » » » » Text: "Task timed out",
296 » » » }
294 case TaskBotDied: 297 case TaskBotDied:
295 » » » step.FailureDetails.Text = "Bot died" 298 » » » step.FailureDetails = &miloProto.FailureDetails{
299 » » » » Type: miloProto.FailureDetails_INFRA,
300 » » » » Text: "Bot died",
301 » » » }
296 } 302 }
297 303
298 case TaskCanceled: 304 case TaskCanceled:
299 // Cancelled build is user action, so it is not an infra failure . 305 // Cancelled build is user action, so it is not an infra failure .
300 step.Status = miloProto.Status_FAILURE 306 step.Status = miloProto.Status_FAILURE
301 step.FailureDetails = &miloProto.FailureDetails{ 307 step.FailureDetails = &miloProto.FailureDetails{
302 Type: miloProto.FailureDetails_CANCELLED, 308 Type: miloProto.FailureDetails_CANCELLED,
303 Text: "Task cancelled by user", 309 Text: "Task cancelled by user",
304 } 310 }
305 311
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 case *miloProto.Link_Url: 504 case *miloProto.Link_Url:
499 return &resp.Link{ 505 return &resp.Link{
500 Label: l.Label, 506 Label: l.Label,
501 URL: t.Url, 507 URL: t.Url,
502 } 508 }
503 509
504 default: 510 default:
505 return nil 511 return nil
506 } 512 }
507 } 513 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698