pgrx icon indicating copy to clipboard operation
pgrx copied to clipboard

Support for non-transactional tests?

Open yrashk opened this issue 3 years ago • 1 comments

Is there any appetite to allow #[pg_test] tests to accept an additional attribute that would indicate that the test is not meant to be run within a transaction?

My motivation for this is that I need to test an extension with an architecture employing background workers polling data from a table, and if it's not getting committed, they can't see it.

yrashk avatar Oct 01 '22 20:10 yrashk

How would that work with a test architecture that attempts to run the tests in a parallel fashion?

workingjubilee avatar Oct 02 '22 07:10 workingjubilee

For note, I think we're open to adding support for something like this (maybe it could use subtransactions? idk), it's just a design question. We don't at all want to slow down test suites by forcing any unnecessary serialization in testing, we already do too much unintentionally (and thus in ways that can mostly be fixed).

workingjubilee avatar Oct 04 '22 20:10 workingjubilee