Merge lp://qastaging/~doanac/qa-dashboard/smoke-image-unique into lp://qastaging/qa-dashboard

Proposed by Andy Doan
Status: Merged
Approved by: Andy Doan
Approved revision: 742
Merged at revision: 742
Proposed branch: lp://qastaging/~doanac/qa-dashboard/smoke-image-unique
Merge into: lp://qastaging/qa-dashboard
Diff against target: 64 lines (+28/-1)
2 files modified
smokeng/models.py (+14/-1)
smokeng/tests.py (+14/-0)
To merge this branch: bzr merge lp://qastaging/~doanac/qa-dashboard/smoke-image-unique
Reviewer Review Type Date Requested Status
Joe Talbott Approve
PS Jenkins bot continuous-integration Approve
Paul Larson Approve
Review via email: mp+218336@code.qastaging.launchpad.net

Commit message

dashboard api: remove race condition

The dashboard itself is changing to prevent the creation of duplicate
SmokeImage objects. We'll now get this as an http exception when trying
to create an object. We need to handle that by then doing a GET call
to find the SmokeImage created by the other thread that won the race.

Description of the change

This is the backend change needed by:

  https://code.launchpad.net/~doanac/ubuntu-test-cases/ttouch-race/+merge/218335

See commit-message for dirty details

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:741
http://s-jenkins.ubuntu-ci:8080/job/dashboard-ci/324/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/dashboard-ci/324/rebuild

review: Approve (continuous-integration)
Revision history for this message
Paul Larson (pwlars) wrote :

Looks sane to me, but I'll let someone with more familiarity in the dashboard have the final say.

review: Approve
Revision history for this message
Joe Talbott (joetalbott) wrote :

L28 - Doesn't this code get called when there is an existing entry as well? I haven't read the context but it looks like this is in the save() override and my assumption is that save on an existing object instance would raise the DBError here.

review: Needs Information
742. By Andy Doan

code-review catch by josepht

The save method was only working if you changed the object in a
certain way. This fixes the check

Revision history for this message
Andy Doan (doanac) wrote :

On 05/06/2014 06:28 AM, Joe Talbott wrote:
> Review: Needs Information
>
> L28 - Doesn't this code get called when there is an existing entry as well? I haven't read the context but it looks like this is in the save() override and my assumption is that save on an existing object instance would raise the DBError here.
>
Good catch. In my testing I was always changing something like the
"variant". So it became a new SmokeImage object. However, the code
didn't work if you changed a flag like "publish". This fixes things.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:742
http://s-jenkins.ubuntu-ci:8080/job/dashboard-ci/325/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/dashboard-ci/325/rebuild

review: Approve (continuous-integration)
Revision history for this message
Joe Talbott (joetalbott) wrote :

This looks okay to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches