mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-17 02:12:56 +00:00
Wait LFC prewarm completion in the loop in test_lfc_prewarm.py
This commit is contained in:
@@ -27,12 +27,16 @@ def test_lfc_prewarm(neon_simple_env: NeonEnv):
|
||||
endpoint.stop()
|
||||
endpoint.start()
|
||||
|
||||
time.sleep(5) # give prewarm BGW some time to proceed
|
||||
|
||||
conn = endpoint.connect()
|
||||
cur = conn.cursor()
|
||||
cur.execute("select file_cache_used from neon_stat_file_cache")
|
||||
lfc_used = cur.fetchall()[0][0]
|
||||
|
||||
for _ in range(20):
|
||||
time.sleep(1) # give prewarm BGW some time to proceed
|
||||
cur.execute("select file_cache_used from neon_stat_file_cache")
|
||||
lfc_used = cur.fetchall()[0][0]
|
||||
if lfc_used > 100:
|
||||
break
|
||||
|
||||
log.info(f"Used LFC size: {lfc_used}")
|
||||
assert lfc_used > 100
|
||||
|
||||
|
||||
Reference in New Issue
Block a user