Our buildbot frequently hits a race in `TestWorker.test_abort`. This
race occurs when `WorkerTestHelpers.triggerGoodBuild` tells the worker
to start a build, which then runs through launchpad-buildd and
eventually attempts to execute launchpad-buildd's helper programs to
unpack a chroot and run an actual build in it; because the Launchpad
test suite isn't set up to run full builds itself (and we wouldn't want
it to even if it were), this fails. If launchpad-buildd manages to do
all this before responding to the subsequent `worker.abort()` call from
the test, then the abort call fails because the builder is unexpectedly
not in the `BUILDING` state any more.
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.test_status_after_build`, which previously had to work
around a similar race; see commit 20737acd94.
Disallow ProductSeries translation exports to most users
Exporting translations for an entire `ProductSeries` can be benign, but
in some cases (e.g. `/linuxmint/latest` on production) it can be very
expensive; and users who aren't admins or responsible for the project in
question should generally export an individual `POTemplate` or `POFile`
instead. Restrict this operation to admins, owners of the project,
release managers of the project series, or owners of applicable
translation groups, in much the same way as we already do for
translation exports of entire source packages.