Skip to content

test: consistently analyze tables exactly once#4930

Merged
wolfgangwalther merged 2 commits into
PostgREST:mainfrom
wolfgangwalther:analyze-spec-tests
May 17, 2026
Merged

test: consistently analyze tables exactly once#4930
wolfgangwalther merged 2 commits into
PostgREST:mainfrom
wolfgangwalther:analyze-spec-tests

Conversation

@wolfgangwalther
Copy link
Copy Markdown
Member

@wolfgangwalther wolfgangwalther commented May 17, 2026

Clean up as mentioned in #4845 (comment).

TODO:

  • adjust costs for < v17
  • adjust IO tests

Comment thread test/io/test_io.py
Comment thread test/spec/Feature/Query/AggregateFunctionsSpec.hs
Comment thread test/spec/Feature/Query/QuerySpec.hs
Copy link
Copy Markdown
Member

@steve-chavez steve-chavez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't get why coverage fails, but overall looks good to me.

@wolfgangwalther
Copy link
Copy Markdown
Member Author

Don't get why coverage fails

It passes locally for me, let's see what a fresh rebase / push does.

@wolfgangwalther
Copy link
Copy Markdown
Member Author

It passes locally for me

Actually it does not. It fails on the big schema step, erroring out with pg_ctl: could not start server. 👀

This is easier to reason about and easier to extend. Also removes a tiny
bit of repetition.
Disabling the autovacuum daemon should also help reproducibility in
theory, although I don't know of any cases where we hit a problem with
that.

VACUUM changes the order of rows that PostgreSQL returns for some table
without explicit ordering, thus doing the latter to make it consistently
reproducible.

After ANALYZE estimates are 100% exact for the moment, so some requests
which returned 206 Partial Response now return 200 instead. The fact
that PostgREST returns 206 on an unfiltered endpoint can probably be
considered a bug.
@wolfgangwalther
Copy link
Copy Markdown
Member Author

Fixed a typo, coverage is good now.

@wolfgangwalther wolfgangwalther merged commit c7260bd into PostgREST:main May 17, 2026
36 checks passed
@wolfgangwalther wolfgangwalther deleted the analyze-spec-tests branch May 17, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants