tests: force an analyze pass after we load data so PG has usable statistics (#77590)
gitea/chrono/pipeline/head This commit looks good Details

This commit is contained in:
Pierre Ducroquet 2023-05-26 10:20:25 +02:00 committed by Lauréline Guérin
parent 3318680f5f
commit 84bdeb3ed3
1 changed files with 3 additions and 0 deletions

View File

@ -1294,6 +1294,9 @@ def test_recurring_events_api_fillslots_multiple_agendas_queries(app, user):
start_datetime=start, places=2, recurrence_end_date=end, recurrence_days=[1, 2], agenda=agenda
)
event.create_all_recurrences()
with connection.cursor() as cursor:
# force an analyze pass after we load data so PG has usable statistics
cursor.execute("ANALYZE;")
agenda_slugs = ','.join(str(i) for i in range(20))
resp = app.get('/api/agendas/recurring-events/?action=update&agendas=%s' % agenda_slugs)