Skip to content

tests: add tests for statement_timeout#2394

Merged
robx merged 1 commit intoPostgREST:mainfrom
robx:test-timeout
Jul 29, 2022
Merged

tests: add tests for statement_timeout#2394
robx merged 1 commit intoPostgREST:mainfrom
robx:test-timeout

Conversation

@robx
Copy link
Copy Markdown
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
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.

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