Skip to content

Commit

Permalink
Disable pool recycle in tests
Browse files Browse the repository at this point in the history
The default for connection_recycle_time is
one hour. If any test using StaticSqlFixture
runs after 1 hour it fails as connection get's
recycled.

With sqlite memory db if there is a connection
disconnect or reconnect db get's wiped off.
This patch disables the pool recycle so tests
can run fine even in slow environments.

Closes-Bug: #2024674
Change-Id: I04f120d3ccd11b18ae08cb10b19a7cb5a0e8983d
  • Loading branch information
karelyatin committed Jun 26, 2023
1 parent b86ca71 commit 576c468
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions neutron/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ def setUp(self):
# for more info.
db_options.set_defaults(cfg.CONF, connection='sqlite://')

# NOTE(ykarel): Disable pool recycle as tables are dropped with sqlite
# memory db with connection close or reconnect
cfg.CONF.set_override('connection_recycle_time', -1, group='database')

# Configure this first to ensure pm debugging support for setUp()
debugger = os.environ.get('OS_POST_MORTEM_DEBUGGER')
if debugger:
Expand Down

0 comments on commit 576c468

Please sign in to comment.