diff --git a/test/t/007_inserts.pl b/test/t/007_inserts.pl index cc9e8e9..8615544 100644 --- a/test/t/007_inserts.pl +++ b/test/t/007_inserts.pl @@ -34,6 +34,10 @@ $node->pgbench( sub idx_scan { + # stats do not update instantaneously + # https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-STATS-VIEWS + sleep(1); + $node->safe_psql("postgres", "SELECT pg_stat_clear_snapshot();"); $node->safe_psql("postgres", "SELECT idx_scan FROM pg_stat_user_indexes WHERE indexrelid = 'tst_v_idx'::regclass;"); }