Permalink
Browse files

test: fix test replication on PG_HEAD (#734)

  • Loading branch information...
jorsol authored and davecramer committed Jan 20, 2017
1 parent aca26a0 commit 3b406a18a7c1751aa477e8378ee8cad0a60efd1e
Showing with 41 additions and 34 deletions.
  1. +29 −29 .travis.yml
  2. +12 −5 .travis/travis_configure_replication.sh
@@ -68,6 +68,13 @@ matrix:
- FEDORA_CI=Y
services:
- docker
- jdk: oraclejdk8
sudo: required
dist: trusty
env:
- PG_VERSION=HEAD
- XA=true
- REPLICATION=Y
- jdk: oraclejdk8
sudo: required
dist: trusty
@@ -86,6 +93,21 @@ matrix:
- XA=true
- REPLICATION=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
sudo: required
dist: precise
@@ -98,43 +120,30 @@ matrix:
- jdk: oraclejdk8
sudo: required
dist: precise
env: # this has to match allow_failures above
- PG_VERSION=8.2
env:
- PG_VERSION=8.3
- XA=true
- COVERAGE=Y
- NO_HSTORE=Y
- CREATE_PLPGSQL=Y
- jdk: oraclejdk8
sudo: required
dist: precise
env:
- PG_VERSION=8.3
env: # this has to match allow_failures above
- PG_VERSION=8.2
- XA=true
- COVERAGE=Y
- NO_HSTORE=Y
- CREATE_PLPGSQL=Y
- jdk: oraclejdk8
- jdk: oraclejdk8 # this will be overwritten by before_install above
addons:
postgresql: "9.4"
apt:
packages:
- oracle-java8-installer
sudo: required
dist: trusty
- oracle-java9-installer
env:
- PG_VERSION=9.4
- XA=true
- REPLICATION=Y
- COVERAGE=Y
- MCENTRAL=Y
- JDOC=Y
- jdk: oraclejdk8
sudo: required
dist: trusty
env:
- PG_VERSION=HEAD
- XA=true
- REPLICATION=Y
- JDK=9
- jdk: openjdk7
addons:
postgresql: "9.4"
@@ -153,15 +162,6 @@ matrix:
env:
- PG_VERSION=9.4
- 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
addons:
postgresql: "9.4"
@@ -1,6 +1,13 @@
#!/usr/bin/env bash
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" ]
then
if [ "${PG_VERSION}" = "HEAD" ]
@@ -10,15 +17,15 @@ then

if (( $(echo "${PG_VERSION} >= 9.1" | bc -l)))
then
sudo sed -i -e 's/#max_wal_senders = 0/max_wal_senders = 4/g' ${PG_DATADIR}/postgresql.conf
sudo sed -i -e 's/#wal_keep_segments = 0/wal_keep_segments = 4/g' ${PG_DATADIR}/postgresql.conf
sudo sed -i -e 's/#wal_sender_timeout = .*/wal_sender_timeout = 2000/g' ${PG_DATADIR}/postgresql.conf
set_conf_property "max_wal_senders" "10"
set_conf_property "wal_keep_segments" "10"
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/^#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)))
then
sudo sed -i -e 's/#wal_level = minimal/wal_level = logical/g' ${PG_DATADIR}/postgresql.conf
sudo sed -i -e 's/#max_replication_slots = 0/max_replication_slots = 4/g' ${PG_DATADIR}/postgresql.conf
set_conf_property "wal_level" "logical"
set_conf_property "max_replication_slots" "10"
fi
fi
fi

0 comments on commit 3b406a1

Please sign in to comment.