mirror of
https://github.com/reactos/syzkaller.git
synced 2024-12-03 17:01:28 +00:00
dashboard/app: fix a bug with bugs with seq>0
See the added test.
This commit is contained in:
parent
013a8d4c00
commit
06091e7473
@ -349,11 +349,12 @@ func apiReportCrash(c context.Context, ns string, r *http.Request) (interface{},
|
||||
return nil, err
|
||||
}
|
||||
|
||||
bug := new(Bug)
|
||||
var bug *Bug
|
||||
var bugKey *datastore.Key
|
||||
|
||||
tx := func(c context.Context) error {
|
||||
for seq := int64(0); ; seq++ {
|
||||
bug = new(Bug)
|
||||
bugHash := bugKeyHash(ns, req.Title, seq)
|
||||
bugKey = datastore.NewKey(c, "Bug", bugHash, 0, nil)
|
||||
if err := datastore.Get(c, bugKey, bug); err != nil {
|
||||
|
@ -118,6 +118,15 @@ func TestFixBasic(t *testing.T) {
|
||||
c.expectOK(c.API(client1, key1, "report_crash", crash1, nil))
|
||||
reports = reportAllBugs(c, 1)
|
||||
c.expectEQ(reports[0].Title, "title1 (2)")
|
||||
|
||||
// Regression test: previously upstreamming failed because the new bug had fixing commits.
|
||||
c.expectOK(c.API(client1, key1, "report_crash", crash1, nil))
|
||||
cmd = &dashapi.BugUpdate{
|
||||
ID: reports[0].ID,
|
||||
Status: dashapi.BugStatusUpstream,
|
||||
}
|
||||
c.expectOK(c.API(client1, key1, "reporting_update", cmd, reply))
|
||||
c.expectEQ(reply.OK, true)
|
||||
}
|
||||
|
||||
// Test bug that is fixed by 2 commits.
|
||||
|
Loading…
Reference in New Issue
Block a user