Skip to content

Commit f805b43

Browse files
authored
test session mode and config reload for real (#33)
* test session mode and config reload for real * period * run them at the end * typo * wrong dir
1 parent 86941d6 commit f805b43

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.circleci/run_tests.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ psql -e -h 127.0.0.1 -p 6432 -f tests/sharding/query_routing_test_select.sql > /
3434
# Replica/primary selection & more sharding tests
3535
psql -e -h 127.0.0.1 -p 6432 -f tests/sharding/query_routing_test_primary_replica.sql > /dev/null
3636

37-
# Test reload config
38-
kill -SIGHUP $(pgrep pgcat)
39-
4037
#
4138
# ActiveRecord tests!
4239
#
@@ -45,6 +42,16 @@ sudo gem install bundler
4542
bundle install
4643
ruby tests.rb
4744

45+
cd ../../
46+
# Test session mode (and config reload)
47+
sed -i 's/pool_mode = "transaction"/pool_mode = "session"/' pgcat.toml
48+
49+
# Reload config
50+
kill -SIGHUP $(pgrep pgcat)
51+
52+
# Prepared statements that will only work in session mode
53+
pgbench -h 127.0.0.1 -p 6432 -t 500 -c 2 --protocol prepared
54+
4855
# Attempt clean shut down
4956
killall pgcat -s SIGINT
5057

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ See [sharding README](./tests/sharding/README.md) for sharding logic testing.
5050
| **Feature** | **Tested in CI** | **Tested manually** | **Comments** |
5151
|-----------------------|--------------------|---------------------|--------------------------------------------------------------------------------------------------------------------------|
5252
| Transaction pooling | :heavy_check_mark: | :heavy_check_mark: | Used by default for all tests. |
53-
| Session pooling | :x: | :heavy_check_mark: | Easiest way to test is to enable it and run pgbench - results will be better than transaction pooling as expected. |
53+
| Session pooling | :heavy_check_mark: | :heavy_check_mark: | Tested by running pgbench with `--protocol prepared` which only works in session mode. |
5454
| `COPY` | :heavy_check_mark: | :heavy_check_mark: | `pgbench -i` uses `COPY`. `COPY FROM` is tested as well. |
5555
| Query cancellation | :heavy_check_mark: | :heavy_check_mark: | `psql -c 'SELECT pg_sleep(1000);'` and press `Ctrl-C`. |
5656
| Load balancing | :x: | :heavy_check_mark: | We could test this by emitting statistics for each replica and compare them. |

0 commit comments

Comments
 (0)