3535# GO_VERSION is the Go version used for the release build, docker files, and
3636# GitHub Actions. This is the reference version for the project. All other Go
3737# versions are checked against this version.
38- GO_VERSION = 1.22.6
38+ GO_VERSION = 1.22.11
3939
4040GOBUILD := $(LOOPVARFIX ) go build -v
4141GOINSTALL := $(LOOPVARFIX ) go install -v
@@ -195,19 +195,31 @@ ifeq ($(dbbackend),postgres)
195195 docker rm lnd-postgres --force || echo "Starting new postgres container"
196196
197197 # Start a fresh postgres instance. Allow a maximum of 500 connections so
198- # that multiple lnd instances with a maximum number of connections of 50
199- # each can run concurrently.
200- docker run --name lnd-postgres -e POSTGRES_PASSWORD=postgres -p 6432:5432 -d postgres:13-alpine -N 500
201- docker logs -f lnd-postgres &
198+ # that multiple lnd instances with a maximum number of connections of 20
199+ # each can run concurrently. Note that many of the settings here are
200+ # specifically for integration testing and are not fit for running
201+ # production nodes. The increase in max connections ensures that there
202+ # are enough entries allocated for the RWConflictPool to allow multiple
203+ # conflicting transactions to track serialization conflicts. The
204+ # increase in predicate locks and locks per transaction is to allow the
205+ # queries to lock individual rows instead of entire tables, helping
206+ # reduce serialization conflicts. Disabling sequential scan for small
207+ # tables also helps prevent serialization conflicts by ensuring lookups
208+ # lock only relevant rows in the index rather than the entire table.
209+ docker run --name lnd-postgres -e POSTGRES_PASSWORD=postgres -p 6432:5432 -d postgres:13-alpine -N 1500 -c max_pred_locks_per_transaction=1024 -c max_locks_per_transaction=128 -c enable_seqscan=off
210+ docker logs -f lnd-postgres >itest/postgres.log 2>&1 &
202211
203212 # Wait for the instance to be started.
204213 sleep $(POSTGRES_START_DELAY)
205214endif
206215
216+ clean-itest-logs :
217+ rm -rf itest/* .log itest/.logs-*
218+
207219# ? itest-only: Only run integration tests without re-building binaries
208- itest-only : db-instance
220+ itest-only : clean-itest-logs db-instance
209221 @$(call print, "Running integration tests with ${backend} backend.")
210- rm -rf itest/ * .log itest/.logs- * ; date
222+ date
211223 EXEC_SUFFIX=$(EXEC_SUFFIX ) scripts/itest_part.sh 0 1 $(TEST_FLAGS ) $(ITEST_FLAGS )
212224 $(COLLECT_ITEST_COVERAGE )
213225
@@ -218,9 +230,9 @@ itest: build-itest itest-only
218230itest-race : build-itest-race itest-only
219231
220232# ? itest-parallel: Build and run integration tests in parallel mode, running up to ITEST_PARALLELISM test tranches in parallel (default 4)
221- itest-parallel : build-itest db-instance
233+ itest-parallel : clean-itest-logs build-itest db-instance
222234 @$(call print, "Running tests")
223- rm -rf itest/ * .log itest/.logs- * ; date
235+ date
224236 EXEC_SUFFIX=$(EXEC_SUFFIX ) scripts/itest_parallel.sh $(ITEST_PARALLELISM ) $(NUM_ITEST_TRANCHES ) $(TEST_FLAGS ) $(ITEST_FLAGS )
225237 $(COLLECT_ITEST_COVERAGE )
226238
0 commit comments