Merge lp:~stub/launchpad/pgbouncer-fixture into lp:launchpad
Status: | Merged |
---|---|
Approved by: | William Grant |
Approved revision: | no longer in the source branch. |
Merged at revision: | 13863 |
Proposed branch: | lp:~stub/launchpad/pgbouncer-fixture |
Merge into: | lp:launchpad |
Prerequisite: | lp:~stub/launchpad/disco |
Diff against target: |
249 lines (+132/-10) 6 files modified
configs/testrunner/launchpad-lazr.conf (+4/-4) lib/lp/testing/fixture.py (+58/-1) lib/lp/testing/pgsql.py (+7/-4) lib/lp/testing/tests/test_fixture.py (+61/-1) setup.py (+1/-0) versions.cfg (+1/-0) |
To merge this branch: | bzr merge lp:~stub/launchpad/pgbouncer-fixture |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
William Grant | code | Approve | |
Review via email: mp+73283@code.launchpad.net |
Description of the change
= Summary =
We need to test disconnection handling for fastdowntime deployments.
== Proposed fix ==
Add a pgbouncer fixture. When the fixture is installed, database connections are made via the pgbouncer proxy. pgbouncer can be started and stopped at will, duplicating what happens on staging and production during fastdowntime deployments.
== Pre-implementation notes ==
== Implementation details ==
The pgbouncer debian package needs to be added to our developer dependencies before this branch can land.
== Tests ==
== Demo and Q/A ==
= Launchpad lint =
There is old lint in pgsql.py I have not fixed.
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
versions.cfg
setup.py
lib/lp/
configs/
./lib/lp/
90: Line exceeds 78 characters.
270: Line exceeds 78 characters.
281: Line exceeds 78 characters.
282: Line exceeds 78 characters.
346: Line exceeds 78 characters.
350: Line exceeds 78 characters.
47: E261 at least two spaces before inline comment
90: E501 line too long (80 characters)
133: E302 expected 2 blank lines, found 0
136: E302 expected 2 blank lines, found 1
142: E302 expected 2 blank lines, found 1
151: E261 at least two spaces before inline comment
329: E225 missing whitespace around operator
341: E225 missing whitespace around operator
346: E501 line too long (88 characters)
350: E501 line too long (83 characters)
351: E225 missing whitespace around operator
365: E261 at least two spaces before inline comment
./configs/
140: Line exceeds 78 characters.
One tweak: ableFixture( 'PGPORT' , str(self.port)) ableFixture( 'PGHOST' , 'localhost') (reconnect_ stores) (pgport_ fixture. cleanUp) (pghost_ fixture. cleanUp) fixture. setUp() fixture. setUp()
+ pgport_fixture = EnvironmentVari
+ pghost_fixture = EnvironmentVari
+
+ # reconnect_store cleanup added first so it is run last, after
+ # the environment variables have been reset.
+ self.addCleanup
+ self.addCleanup
+ self.addCleanup
+
+ pgport_
+ pghost_
-> (reconnect_ stores) (EnvironmentVar iableFixture( 'PGPORT' , str(self.port))) (EnvironmentVar iableFixture( 'PGHOST' , 'localhost'))
+ # reconnect_store cleanup added first so it is run last, after
+ # the environment variables have been reset.
+ self.addCleanup
+ self.useFixture
+ self.useFixture
:)