Skip to content
Snippets Groups Projects
Commit 12dff4bf authored by Patrick Steinhardt's avatar Patrick Steinhardt
Browse files

praefect: Fix flaky Postgres read/write check test

The test which verifies that the read/write check for Postgres fails as
expected on a read-only database fails as expected is flaky. The root
cause of this is the use of a timeout: we first lock the table that
we're about to read in one transaction, then spawn the command which
hangs while trying to read the database and then wait for the timeout to
kick in. This doesn't really test what we want to test though: it only
verifies that the command aborts with a timeout, but doesn't check
against a real read-only database. Furthermore, the timeout leads to
flakiness in our CI pipeline.

Fix the test to really test what we want to by creating a read-only user
first, which is then used to connect to the database. Like this,
inserting on the table will fail as expected and we don't need to use a
timeout at all.
parent 124ad5a6
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment