Skip to content

Commit

Permalink
test: fix test replication on PG_HEAD (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorsol authored and davecramer committed Jan 20, 2017
1 parent aca26a0 commit 3b406a1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 34 deletions.
58 changes: 29 additions & 29 deletions .travis.yml
Expand Up @@ -68,6 +68,13 @@ matrix:
- FEDORA_CI=Y - FEDORA_CI=Y
services: services:
- docker - docker
- jdk: oraclejdk8
sudo: required
dist: trusty
env:
- PG_VERSION=HEAD
- XA=true
- REPLICATION=Y
- jdk: oraclejdk8 - jdk: oraclejdk8
sudo: required sudo: required
dist: trusty dist: trusty
Expand All @@ -86,6 +93,21 @@ matrix:
- XA=true - XA=true
- REPLICATION=Y - REPLICATION=Y
- COVERAGE=Y - COVERAGE=Y
- jdk: oraclejdk8
addons:
postgresql: "9.4"
apt:
packages:
- oracle-java8-installer
sudo: required
dist: trusty
env:
- PG_VERSION=9.4
- XA=true
- REPLICATION=Y
- COVERAGE=Y
- MCENTRAL=Y
- JDOC=Y
- jdk: oraclejdk8 - jdk: oraclejdk8
sudo: required sudo: required
dist: precise dist: precise
Expand All @@ -98,43 +120,30 @@ matrix:
- jdk: oraclejdk8 - jdk: oraclejdk8
sudo: required sudo: required
dist: precise dist: precise
env: # this has to match allow_failures above env:
- PG_VERSION=8.2 - PG_VERSION=8.3
- XA=true - XA=true
- COVERAGE=Y - COVERAGE=Y
- NO_HSTORE=Y - NO_HSTORE=Y
- CREATE_PLPGSQL=Y - CREATE_PLPGSQL=Y
- jdk: oraclejdk8 - jdk: oraclejdk8
sudo: required sudo: required
dist: precise dist: precise
env: env: # this has to match allow_failures above
- PG_VERSION=8.3 - PG_VERSION=8.2
- XA=true - XA=true
- COVERAGE=Y - COVERAGE=Y
- NO_HSTORE=Y - NO_HSTORE=Y
- CREATE_PLPGSQL=Y - CREATE_PLPGSQL=Y
- jdk: oraclejdk8 - jdk: oraclejdk8 # this will be overwritten by before_install above
addons: addons:
postgresql: "9.4" postgresql: "9.4"
apt: apt:
packages: packages:
- oracle-java8-installer - oracle-java9-installer
sudo: required
dist: trusty
env: env:
- PG_VERSION=9.4 - PG_VERSION=9.4
- XA=true - JDK=9
- REPLICATION=Y
- COVERAGE=Y
- MCENTRAL=Y
- JDOC=Y
- jdk: oraclejdk8
sudo: required
dist: trusty
env:
- PG_VERSION=HEAD
- XA=true
- REPLICATION=Y
- jdk: openjdk7 - jdk: openjdk7
addons: addons:
postgresql: "9.4" postgresql: "9.4"
Expand All @@ -153,15 +162,6 @@ matrix:
env: env:
- PG_VERSION=9.4 - PG_VERSION=9.4
- TEST_CLIENTS=Y - TEST_CLIENTS=Y
- jdk: oraclejdk8 # this will be overwritten by before_install above
addons:
postgresql: "9.4"
apt:
packages:
- oracle-java9-installer
env:
- PG_VERSION=9.4
- JDK=9
- jdk: oraclejdk8 - jdk: oraclejdk8
addons: addons:
postgresql: "9.4" postgresql: "9.4"
Expand Down
17 changes: 12 additions & 5 deletions .travis/travis_configure_replication.sh
@@ -1,6 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -x -e set -x -e


set_conf_property() {
local key=${1}
local value=${2}

sudo sed -i -e "s/^#\?${key}.*/${key} = ${value}/g" ${PG_DATADIR}/postgresql.conf
}

if [ "${REPLICATION}" = "Y" ] if [ "${REPLICATION}" = "Y" ]
then then
if [ "${PG_VERSION}" = "HEAD" ] if [ "${PG_VERSION}" = "HEAD" ]
Expand All @@ -10,15 +17,15 @@ then


if (( $(echo "${PG_VERSION} >= 9.1" | bc -l))) if (( $(echo "${PG_VERSION} >= 9.1" | bc -l)))
then then
sudo sed -i -e 's/#max_wal_senders = 0/max_wal_senders = 4/g' ${PG_DATADIR}/postgresql.conf set_conf_property "max_wal_senders" "10"
sudo sed -i -e 's/#wal_keep_segments = 0/wal_keep_segments = 4/g' ${PG_DATADIR}/postgresql.conf set_conf_property "wal_keep_segments" "10"
sudo sed -i -e 's/#wal_sender_timeout = .*/wal_sender_timeout = 2000/g' ${PG_DATADIR}/postgresql.conf set_conf_property "wal_sender_timeout" "5s"
sudo sed -i -e 's/^#local\s\+replication\s\+postgres\s\+\(.*\)/local replication all \1/g' ${PG_DATADIR}/pg_hba.conf sudo sed -i -e 's/^#local\s\+replication\s\+postgres\s\+\(.*\)/local replication all \1/g' ${PG_DATADIR}/pg_hba.conf
sudo sed -i -e 's/^#host\s\+replication\s\+postgres\s\+\(.*\)\s\+\(.*\)/host replication all \1 \2/g' ${PG_DATADIR}/pg_hba.conf sudo sed -i -e 's/^#host\s\+replication\s\+postgres\s\+\(.*\)\s\+\(.*\)/host replication all \1 \2/g' ${PG_DATADIR}/pg_hba.conf
if (( $(echo "${PG_VERSION} >= 9.4" | bc -l))) if (( $(echo "${PG_VERSION} >= 9.4" | bc -l)))
then then
sudo sed -i -e 's/#wal_level = minimal/wal_level = logical/g' ${PG_DATADIR}/postgresql.conf set_conf_property "wal_level" "logical"
sudo sed -i -e 's/#max_replication_slots = 0/max_replication_slots = 4/g' ${PG_DATADIR}/postgresql.conf set_conf_property "max_replication_slots" "10"
fi fi
fi fi
fi fi

0 comments on commit 3b406a1

Please sign in to comment.