Merge lp://staging/~michael.nelson/launchpad/627608-p3a-token-race into lp://staging/launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Michael Hudson-Doyle | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 11812 | ||||
Proposed branch: | lp://staging/~michael.nelson/launchpad/627608-p3a-token-race | ||||
Merge into: | lp://staging/launchpad | ||||
Diff against target: |
90 lines (+50/-6) 2 files modified
lib/lp/archivepublisher/scripts/generate_ppa_htaccess.py (+7/-2) lib/lp/archivepublisher/tests/test_generate_ppa_htaccess.py (+43/-4) |
||||
To merge this branch: | bzr merge lp://staging/~michael.nelson/launchpad/627608-p3a-token-race | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Hudson-Doyle | Approve | ||
Review via email: mp+39469@code.staging.launchpad.net |
Commit message
p3a access tokens created in the window when the generate_
Description of the change
Overview
========
This branch ensures that if a token is created *while* the generate_
Details
=======
We did some work recently to improve the generate_
We recently saw bug 627608 happening again, even though the script was running minutely, and discovered that if the token is created in the tiny window *after* a run of the script has started, but before it is finished, then it won't be included in the next run either (more detailed description on the bug).
The branch does the adds a test and trivial fix, and fixes an existing test which was incorrectly setting the date_started for the script activity.
To test
=======
bin/test -vvm test_generate_
It's very picky, but I think I'd find the tests easier to understand if you gave the times names, like so:
earliest = now - timedelta( seconds= 20) seconds= 10) seconds= 15)
latest = now - timedelta(
in_between = now - timedelta(
and use keyword arguments in the calls to recordSuccess then it's a bit easier to see the relationship between them. Not 100% sure about the names.
Even if you don't do this, the change looks good to land. Congratulations on finding the problem :-)