`devshard`: It would be worth adding small tests asserting `pool.Config().MaxConns` for both payload storage constructors. `ConfigureMaxConns` itself is well tested, but the current tests wouldn’t catch the helper being accidentally removed from either constructor. #1851
Looks good overall, approved. It would be worth adding small tests asserting pool.Config().MaxConns for both payload storage constructors. ConfigureMaxConns itself is well tested, but the current tests wouldn’t catch the helper being accidentally removed from either constructor.
Originally posted by @aikuznetsov in https://github.com/gonka-ai/gonka/pull/1840#pullrequestreview-5312588423
💬 Comments (2)
Closed with https://github.com/gonka-ai/gonka/pull/1883
🔄 Auto-synced from Issue #1851 every hour.
Added in #1883 : tests for both payload constructors,
newPostgresStorage(common/storage/payloads) andNewPostgresStorage(decentralized-api/payloadstorage).PG_POOL_MAX_CONNSmust fail the constructor with the helper's error before any connection is made. Runs in-short, no Docker.pool.Config().MaxConnsis the default when the variable is unset and3when it is set.3is below pgx's floor of 4, so the check does not depend on the CPU count.Verified by removing the
ConfigureMaxConnscall from both constructors: every new test fails, on hosts pinned to 3, 4 and 8 CPUs.@akup