Skip to content

Commit 37bc09e

Browse files
committed
ci: set max connections
1 parent bb4f791 commit 37bc09e

File tree

1 file changed

+43
-22
lines changed

1 file changed

+43
-22
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ concurrency:
1515
env:
1616
CARGO_TERM_COLOR: always
1717
RUST_BACKTRACE: full
18-
THEGRAPH_STORE_POSTGRES_DIESEL_URL: "postgresql://postgres:postgres@localhost:5432/graph_node_test"
18+
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -D warnings"
19+
THEGRAPH_STORE_POSTGRES_DIESEL_URL: "postgresql://graph:graph@localhost:5432/graph-test"
1920

2021
jobs:
2122
unit-tests:
@@ -30,21 +31,29 @@ jobs:
3031
postgres:
3132
image: postgres
3233
env:
33-
POSTGRES_PASSWORD: postgres
34-
POSTGRES_DB: graph_node_test
34+
POSTGRES_USER: graph
35+
POSTGRES_PASSWORD: graph
36+
POSTGRES_DB: graph-test
3537
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=C"
36-
POSTGRESQL_EXTRA_FLAGS: "-c max_connections=1000"
3738
options: >-
38-
--health-cmd pg_isready
39+
--health-cmd "pg_isready -U graph"
3940
--health-interval 10s
4041
--health-timeout 5s
4142
--health-retries 5
43+
--name postgres
4244
ports:
4345
- 5432:5432
44-
env:
45-
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -D warnings"
4646
steps:
4747
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
48+
- name: Alter postgres max connections
49+
run: |
50+
docker exec -i postgres bash << EOF
51+
sed -i -e 's/max_connections = 100/max_connections = 1000/' /var/lib/postgresql/data/postgresql.conf
52+
sed -i -e 's/shared_buffers = 128MB/shared_buffers = 2GB/' /var/lib/postgresql/data/postgresql.conf
53+
EOF
54+
docker restart --timeout 0 postgres
55+
sleep 5
56+
4857
- name: Setup dependencies
4958
run: |
5059
sudo apt-get update
@@ -74,26 +83,31 @@ jobs:
7483
ports:
7584
- 5001:5001
7685
postgres:
77-
image: bitnami/postgresql
86+
image: postgres
7887
env:
79-
POSTGRES_PASSWORD: postgres
80-
POSTGRES_DB: graph_node_test
88+
POSTGRES_USER: graph
89+
POSTGRES_PASSWORD: graph
90+
POSTGRES_DB: graph-test
8191
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=C"
82-
POSTGRESQL_EXTRA_FLAGS: "-c max_connections=1000"
83-
POSTGRESQL_REPLICATION_USE_PASSFILE: no
8492
options: >-
85-
--health-cmd "pg_isready -U postgres"
93+
--health-cmd "pg_isready -U graph"
8694
--health-interval 10s
8795
--health-timeout 5s
88-
--health-retries 10
96+
--health-retries 5
97+
--name postgres
8998
ports:
9099
- 5432:5432
91-
env:
92-
GRAPH_IPFS_REQUEST_TIMEOUT: "60"
93-
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -D warnings --cfg test_with_ipfs"
94-
RUNNER_TESTS_WAIT_FOR_SYNC_SECS: "600"
95100
steps:
96101
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
102+
- name: Alter postgres max connections
103+
run: |
104+
docker exec -i postgres bash << EOF
105+
sed -i -e 's/max_connections = 100/max_connections = 1000/' /var/lib/postgresql/data/postgresql.conf
106+
sed -i -e 's/shared_buffers = 128MB/shared_buffers = 2GB/' /var/lib/postgresql/data/postgresql.conf
107+
EOF
108+
docker restart --timeout 0 postgres
109+
sleep 5
110+
97111
- name: Setup dependencies
98112
run: |
99113
sudo apt-get update
@@ -141,18 +155,25 @@ jobs:
141155
POSTGRES_PASSWORD: let-me-in
142156
POSTGRES_DB: graph-node
143157
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=C"
144-
POSTGRESQL_EXTRA_FLAGS: "-c max_connections=1000"
145158
options: >-
146-
--health-cmd pg_isready
159+
--health-cmd "pg_isready -U graph-node"
147160
--health-interval 10s
148161
--health-timeout 5s
149162
--health-retries 5
163+
--name postgres
150164
ports:
151165
- 3011:5432
152-
env:
153-
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -D warnings"
154166
steps:
155167
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
168+
- name: Alter postgres max connections
169+
run: |
170+
docker exec -i postgres bash << EOF
171+
sed -i -e 's/max_connections = 100/max_connections = 1000/' /var/lib/postgresql/data/postgresql.conf
172+
sed -i -e 's/shared_buffers = 128MB/shared_buffers = 2GB/' /var/lib/postgresql/data/postgresql.conf
173+
EOF
174+
docker restart --timeout 0 postgres
175+
sleep 5
176+
156177
- name: Setup dependencies
157178
run: |
158179
sudo apt-get update

0 commit comments

Comments
 (0)