FINERACT-2525: Accept MariaDB snapshot isolation conflict responses in savings integration tests#5763
Conversation
|
Please sign your commits as described in the CONTRIBUTING.md signing guide. |
659a44f to
36ead12
Compare
| assertTrue( | ||
| SC_OK == statusCode1 | ||
| || SC_CONFLICT == statusCode1 | ||
| || (SC_FORBIDDEN == statusCode1 && msg1.contains("Record has changed since last read")), |
There was a problem hiding this comment.
Matching on Record has changed since last read is fragile - if database changes the error message text in a future version, these tests will break again. If the exception were classified as SomeConcurrencyException(not sure, need to check what the actual exception being thrown is) at the ErrorHandler level instead, it would map to 409, and the tests would just work since they already accept SC_CONFLICT.
There was a problem hiding this comment.
Updated this based on your suggestion.
Instead of matching that message in the test, I changed the exception classification in ErrorHandler so the MariaDB snapshot-isolation case (Record has changed since last read) is treated as a concurrency / pessimistic locking failure and follows the existing 409 Conflict path.
I also verified it locally with:
SavingsAccountTransactionTest.testDeadlockSavingsBatchTransactionsSavingsAccountTransactionTest.testConcurrentSavingsBatchTransactions
36ead12 to
009c275
Compare
Please run: Before any PR or changes, please always run these two commands and make sure there is green build! |
… savings integration tests
009c275 to
1943c16
Compare
What changed
Why
How I tested