Race condition in TestDiffInScripts.test_fromFile_withError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Tim Penhey |
Bug Description
This test underwent a spurious failure recently: TestDiffInScrip
The problem is with the way it tries to prove that a particular operation generates an oops. It does this by recording the error reporting utility's lastid before the operation. Then at the end, after performing the operation, compares the current value to the one it's recorded. This can produce false failures when a date rollover targets oopses to a new directory, resetting the lastid counter to zero. Thus the new lastid value may legitimately be the same as the old one, even though an oops has been generated.
Fixing the test is easy: compare lasterrordir as well as lastid. At least one of the two must change when an oops is generated. But as BjornT points out, it would be nice to have a simple guaranteed incrementing id for testing oopses. The fix leaves open a similar race condition where it's possible for failure to generate an oops may go unnoticed during date rollover.
Related branches
- Michael Hudson-Doyle: Approve
- Björn Tillenius (community): Approve
-
Diff: 465 lines (+224/-17)10 files modifiedlib/canonical/launchpad/webapp/errorlog.py (+9/-1)
lib/canonical/launchpad/webapp/interfaces.py (+5/-0)
lib/lp/code/model/branchmergeproposaljob.py (+9/-0)
lib/lp/code/model/tests/test_branchmergeproposaljobs.py (+98/-1)
lib/lp/code/model/tests/test_diff.py (+2/-4)
lib/lp/codehosting/scanner/tests/test_bzrsync.py (+4/-2)
lib/lp/services/job/runner.py (+22/-7)
lib/lp/services/job/tests/test_runner.py (+63/-0)
lib/lp/testing/__init__.py (+11/-1)
lib/lp/testing/tests/test_fixture.py (+1/-1)
tags: | added: spurious-test-failure tech-debt |
Changed in launchpad-code: | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in launchpad-code: | |
status: | Triaged → In Progress |
assignee: | nobody → Tim Penhey (thumper) |
milestone: | none → 10.04 |
tags: |
added: qa-untestable removed: qa-needstesting |
Changed in launchpad-code: | |
status: | Fix Committed → Fix Released |
Filed bug #567689 about the general problem of not having a reliable way to test OOPS generation.