Merge ~cjwatson/launchpad:fix-build-worker-test-race into launchpad:master
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | a6ff5f26133c325e65a608ccceb42442c1dabdb1 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:fix-build-worker-test-race |
Merge into: | launchpad:master |
Diff against target: |
176 lines (+100/-13) 2 files modified
lib/lp/buildmaster/tests/mock_workers.py (+97/-2) lib/lp/buildmaster/tests/test_interactor.py (+3/-11) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jürgen Gmach | Approve | ||
Review via email: mp+433863@code.launchpad.net |
Commit message
Fix race in build worker tests
Description of the change
Our buildbot frequently hits a race in `TestWorker.
To fix this, we insert a substitute version of the "builder-prep" program that launchpad-buildd calls at the start of a build, which just reads a line from a named pipe and then exits non-zero after doing so. This allows us to control the progress of the build by only writing to that named pipe during test cleanup.
While launchpad-buildd's test harness is now set up to support this, unfortunately the necessary code only landed after we dropped Python 3.5 support from launchpad-buildd, and we still need that in Launchpad. For now, copy the test harness code to avoid this, which is well worth it given how often we run into this test race.
This change also allows simplifying `TestWorker.