summary refs log tree commit diff
path: root/scripts-dev
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2023-10-27 18:29:20 +0100
committerGitHub <noreply@github.com>2023-10-27 18:29:20 +0100
commit11a8ae06325e9a8c9d57e3dff5fdf46a90309cd1 (patch)
tree510f3d18a21c32e0dd114046b914eb0c9c0d5615 /scripts-dev
parentEnsure local invited & knocking users leave before purge. (#16559) (diff)
downloadsynapse-11a8ae06325e9a8c9d57e3dff5fdf46a90309cd1.tar.xz
complement: enable dirty runs (#16520)
* complement: enable dirty runs

* Add changelog

* Set a low connpool limit when running in Complement

Dirty runs can cause many containers to be running concurrently,
which seems to easily exhaust resources on the host. The increased
speedup from dirty runs also seems to use more db connections on
workers, which are misconfigured currently to have
`SUM(workers * cp_max) > max_connections`, causing
```
FATAL:  sorry, too many clients already
```
which results in tests failing.

* Try p=2 concurrency to restrict slowness of servers which causes partial state join tests to flake

* Debug logging

* Only run flakey tests

* Only adjust connection pool limits in worker mode

* Move cp vars to somewhere where they get executed in CI

* Move cp values back to where they actually work

* Debug logging

* Try p=1 to see if this makes worker mode happier

* Remove debug logging
Diffstat (limited to 'scripts-dev')
-rwxr-xr-xscripts-dev/complement.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts-dev/complement.sh b/scripts-dev/complement.sh
index 3e0cddb527..b1a8724b7e 100755
--- a/scripts-dev/complement.sh
+++ b/scripts-dev/complement.sh
@@ -216,6 +216,10 @@ extra_test_args=()
 
 test_packages="./tests/csapi ./tests ./tests/msc3874 ./tests/msc3890 ./tests/msc3391 ./tests/msc3930 ./tests/msc3902"
 
+# Enable dirty runs, so tests will reuse the same container where possible.
+# This significantly speeds up tests, but increases the possibility of test pollution.
+export COMPLEMENT_ENABLE_DIRTY_RUNS=1
+
 # All environment variables starting with PASS_ will be shared.
 # (The prefix is stripped off before reaching the container.)
 export COMPLEMENT_SHARE_ENV_PREFIX=PASS_
@@ -274,7 +278,7 @@ fi
 export PASS_SYNAPSE_LOG_TESTING=1
 
 # Run the tests!
-echo "Images built; running complement"
+echo "Images built; running complement with ${extra_test_args[@]} $@ $test_packages"
 cd "$COMPLEMENT_DIR"
 
 go test -v -tags "synapse_blacklist" -count=1 "${extra_test_args[@]}" "$@" $test_packages