Merge ~adam-collard/maas:faster-unit-tests into maas:master

Proposed by Adam Collard
Status: Merged
Approved by: Adam Collard
Approved revision: 9ddbdf910f484cd5800d2cba8b5c38d92f81522f
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~adam-collard/maas:faster-unit-tests
Merge into: maas:master
Diff against target: 35 lines (+18/-0)
1 file modified
src/maasserver/testing/resources.py (+18/-0)
Reviewer Review Type Date Requested Status
Alberto Donato (community) Approve
MAAS Lander Needs Fixing
Review via email: mp+416520@code.launchpad.net

Commit message

Add go faster stripes to postgresfixture

To post a comment you must log in.
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b faster-unit-tests lp:~adam-collard/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/maas/job/branch-tester/12027/console
COMMIT: 5eb672d7d65766883ca1c4e525b2a1534f651796

review: Needs Fixing
Revision history for this message
Adam Collard (adam-collard) wrote :

jenkins: !test

Revision history for this message
Alberto Donato (ack) wrote :

nice! +1

a couple of suggestion/nits inline

review: Approve
~adam-collard/maas:faster-unit-tests updated
9ddbdf9... by Adam Collard

[ack's review] dedent, use Path.read_text()

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/maasserver/testing/resources.py b/src/maasserver/testing/resources.py
index ba8cb7b..8c465b7 100644
--- a/src/maasserver/testing/resources.py
+++ b/src/maasserver/testing/resources.py
@@ -9,6 +9,7 @@ import os
9from pathlib import Path9from pathlib import Path
10import re10import re
11from sys import __stderr__11from sys import __stderr__
12from textwrap import dedent
1213
13from postgresfixture import ClusterFixture14from postgresfixture import ClusterFixture
14import psycopg215import psycopg2
@@ -47,6 +48,23 @@ class DatabaseClusterManager(TestResourceManager):
4748
48 def make(self, dependencies):49 def make(self, dependencies):
49 cluster = ClusterFixture("db", preserve=True)50 cluster = ClusterFixture("db", preserve=True)
51 cluster.create()
52 postgres_path = Path(cluster.datadir)
53 postgres_conf = postgres_path / "postgresql.conf"
54 postgres_speed_conf = postgres_path / "postgresql.conf.speed"
55 if "postgresql.conf.speed" not in postgres_conf.read_text():
56 with postgres_conf.open("a") as fh:
57 fh.write("include = 'postgresql.conf.speed'\n")
58 with postgres_speed_conf.open("w") as fh:
59 fh.write(
60 dedent(
61 """\
62 fsync = off
63 full_page_writes = off
64 synchronous_commit = off
65 """
66 )
67 )
50 cluster.setUp()68 cluster.setUp()
51 return cluster69 return cluster
5270

Subscribers

People subscribed via source and target branches