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

Unified Diff: milo/appengine/swarming/html_data.go

Issue 2717623002: Milo: Handle missing / transient LogDog failures. (Closed)
Patch Set: remote unnecessary code Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: milo/appengine/swarming/html_data.go
diff --git a/milo/appengine/swarming/html_data.go b/milo/appengine/swarming/html_data.go
index 26d53c563ab4f715319dc397bcad5c1ab03eec5d..6230e543c12d086c31b6f270099d019d8325bc89 100644
--- a/milo/appengine/swarming/html_data.go
+++ b/milo/appengine/swarming/html_data.go
@@ -115,6 +115,10 @@ func (tc *testCase) getSwarmingOutput() string {
func (tc *testCase) getAnnotation() *miloProto.Step {
var step miloProto.Step
data := tc.getContent(tc.annotations)
+ if len(data) == 0 {
+ return nil
+ }
+
if err := proto.UnmarshalText(string(data), &step); err != nil {
panic(fmt.Errorf("failed to unmarshal text protobuf [%s]: %s", tc.annotations, err))
}
@@ -183,15 +187,24 @@ func (tc *testLogDogClient) Tail(ctx context.Context, in *logdog.TailRequest, op
if tc.err != nil {
return nil, tc.err
}
+ if tc.resp == nil {
+ return nil, coordinator.ErrNoSuchStream
+ }
return tc.resp.(*logdog.GetResponse), nil
}
func logDogClientFunc(tc *testCase) func(context.Context, string) (*coordinator.Client, error) {
+ anno := tc.getAnnotation()
+ var resp interface{}
+ if anno != nil {
+ resp = datagramGetResponse("testproject", "foo/bar", tc.getAnnotation())
+ }
+
return func(c context.Context, host string) (*coordinator.Client, error) {
return &coordinator.Client{
- Host: "example.com",
+ Host: host,
C: &testLogDogClient{
- resp: datagramGetResponse("testproject", "foo/bar", tc.getAnnotation()),
+ resp: resp,
},
}, nil
}

Powered by Google App Engine
This is Rietveld 408576698