Ghost/test
Fabien 'egg' O'Carroll 022c8c8e69
Added support for 'FOR UPDATE' lock (#14433)
refs https://github.com/TryGhost/Team/issues/1248

This is the underlying cause of the problems we've seen whilst handling
Stripe webhooks. A transaction ensures that the operations are atomic,
but not that they can run concurrently.

If you have some code which does this, concurrently:
1. Starts a transaction
2. Reads a value
3. Changes the values
4. Ends the transaction

Without applying the `FOR UPDATE` lock - you will have both sequenes
read the same value at step 2.

With the `FOR UPDATE` lock - one of the sequences will hang at step 2,
waiting for the other transaction to end, at which point it will resume
and read the _changed_ value.

Because the `edit` method explicitly does a read followed by a write, we
have also add the `FOR UPDATE` lock to this by default, to avoid any race
conditions. This does however require that `edit` is called within a
transaction. An issue here https://github.com/TryGhost/Team/issues/1503
considers running in a transaction by default.
2022-04-08 12:52:33 +01:00
..
e2e-api Added test coverage for Content APIs versioning support 2022-04-08 17:30:10 +08:00
e2e-browser Added note about installing the E2E browsers 2022-02-22 10:20:40 +01:00
e2e-frontend 🐛 Fixed post access in the get helper (#14282) 2022-03-17 11:14:29 +01:00
e2e-server Added MRR stats service and endpoint (#14427) 2022-04-08 09:18:04 +02:00
integration Added table to store multiple newsletters for member (#14408) 2022-04-04 18:11:36 +05:30
regression Added expectEmptyBody assertions to e2e framework 2022-03-31 18:56:05 +01:00
unit Added support for 'FOR UPDATE' lock (#14433) 2022-04-08 12:52:33 +01:00
utils Added default newsletter subscription for new members (#14431) 2022-04-07 08:30:00 +05:30
.eslintignore Updated casper test fixture to latest version 2022-01-25 14:10:53 +00:00
.eslintrc.js Upgraded no-skipped-test rule to error 2021-05-26 14:57:43 +01:00
.jshintrc Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00