diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-08-04 19:13:46 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-08-04 19:19:43 +0200 |
| commit | d23bf3250e6705f2272f5ffa5970948feb202a72 (patch) | |
| tree | ccc8b5c3346a8a87448953c0d372f709b3b1d0fc | |
| parent | 08a7078aabdc90785161ccc34c3b6eca1b337d8d (diff) | |
dashboard/app: fix report_failed_repro api call
We are seeing the following errors in this handler:
cross-group transaction need to be explicitly specified, see TransactionOptions.Builder.withXG
| -rw-r--r-- | dashboard/app/api.go | 2 | ||||
| -rw-r--r-- | dashboard/app/reporting_test.go | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/dashboard/app/api.go b/dashboard/app/api.go index 094ae5936..70a703656 100644 --- a/dashboard/app/api.go +++ b/dashboard/app/api.go @@ -499,7 +499,7 @@ func apiReportFailedRepro(c context.Context, ns string, r *http.Request) (interf } return nil } - if err := datastore.RunInTransaction(c, tx, nil); err != nil { + if err := datastore.RunInTransaction(c, tx, &datastore.TransactionOptions{XG: true}); err != nil { return nil, err } return nil, nil diff --git a/dashboard/app/reporting_test.go b/dashboard/app/reporting_test.go index 58709ff1f..a99c85cd3 100644 --- a/dashboard/app/reporting_test.go +++ b/dashboard/app/reporting_test.go @@ -191,6 +191,13 @@ func TestInvalidBug(t *testing.T) { ReproC: []byte("int main() { return 1; }"), } c.expectEQ(rep, want) + + repro := &dashapi.FailedRepro{ + Manager: build.Manager, + BuildID: build.ID, + Title: crash1.Title, + } + c.expectOK(c.API(client1, key1, "report_failed_repro", repro, nil)) } func TestReportingQuota(t *testing.T) { |
