Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add tests for statement_timeout #2394

Merged
merged 1 commit into from
Jul 29, 2022
Merged

Conversation

robx
Copy link
Contributor

@robx robx commented Jul 29, 2022

Compare the discussion in #2391.

The new tests verify that:

  • statement_timeout on the authenticator role works to cancel slow statements
  • changes to statement_timeout take effect on SIGUSR1

This reuses the old "limited_authenticator" role and adds some plumbing to
allow reliably changing the statement timeout even if the current role is
not functional due to a low statement timeout, and to make tests that modify
the role independent from each other.

  • introduce module-wide metapostgrest fixture to have an out-of-band way to
    manipulate the database, without having to spin up extra postgrest instances
    per test
  • reset statement_timeout at the start of the respective tests

The new tests verify that:
- statement_timeout on the authenticator role works to cancel slow statements
- changes to statement_timeout take effect on SIGUSR1

This reuses the old "limited_authenticator" role and adds some plumbing to
allow reliably changing the statement timeout even if the current role is
not functional due to a low statement timeout, and to make tests that modify
the role independent from each other.

- introduce module-wide metapostgrest fixture to have an out-of-band way to
  manipulate the database, without having to spin up extra postgrest instances
  per test
- reset statement_timeout at the start of the respective tests
Copy link
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.

New metapostgrest looks awesome 💯

@robx robx merged commit d556cea into PostgREST:main Jul 29, 2022
@robx robx deleted the test-timeout branch July 29, 2022 19:47
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