This repository contains the Microsoft Orleans sample titled "Orleans Bank Account with ACID transactions" modified to test Orleans's atomicity guarantee using Antithesis.
This "Bank Test" is intended to be as simple as possible while retaining the capability to test Orleans's atomicity guarantee. To simplify the design:
Bank.Grains/AccountGrain.cswas modified to allow an account to have a negative balance. That simplification allows the bank to start with a total balance of $0 across all accounts.- Because we are only testing atomicity, we can do so with exactly 2 accounts. The test repeatedly, and often in parallel using an Antithesis parallel driver command, transfers $1 from account #0 to account #1.
Bank.Interfaces/IAccountGrain.cswas modified to return an account's balance afterDepositandWithdraw.Bank.Interfaces/ITellerGrain.cswas modified to return the balance of participating accounts after a transfer between those accounts. These changes, combined with the others, allows the test to assert the bank's total balance is $0 after every transfer.
There are also several renames and other cosmetic changes to the sample.
The system under test (see docker-compose.yaml) uses a single bankclient to issue requests to the Orleans cluster. The Orleans cluster comprises bankserver1 and bankserver2. azurite (i.e. the Azure Storage emulator) is used for Orleans cluster membership, grain storage, and transactional state. The Antithesis test (not shown in this repo) is configured to only introduce network faults, and it explicitly excludes the azurite container from all faults; therefore, all services can communicate with azurite without faults throughout the entirety of the test. In the SUT diagram below, dashed lines can be faulted by Antithesis while solid lines cannot.
