(t *testing.T)
| 50 | } |
| 51 | |
| 52 | func TestReadModifyUpdate_HardError(t *testing.T) { |
| 53 | t.Parallel() |
| 54 | |
| 55 | mDB := dbmock.NewMockStore(gomock.NewController(t)) |
| 56 | |
| 57 | mDB.EXPECT(). |
| 58 | InTx(gomock.Any(), &database.TxOptions{Isolation: sql.LevelRepeatableRead}). |
| 59 | Times(1). |
| 60 | Return(xerrors.New("a bad thing happened")) |
| 61 | |
| 62 | err := database.ReadModifyUpdate(mDB, func(tx database.Store) error { |
| 63 | return nil |
| 64 | }) |
| 65 | require.ErrorContains(t, err, "a bad thing happened") |
| 66 | } |
| 67 | |
| 68 | func TestReadModifyUpdate_TooManyRetries(t *testing.T) { |
| 69 | t.Parallel() |
nothing calls this directly
no test coverage detected