MCPcopy Index your code
hub / github.com/coder/coder / TestReadModifyUpdate_TooManyRetries

Function TestReadModifyUpdate_TooManyRetries

coderd/database/tx_test.go:68–81  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestReadModifyUpdate_TooManyRetries(t *testing.T) {
69 t.Parallel()
70
71 mDB := dbmock.NewMockStore(gomock.NewController(t))
72
73 mDB.EXPECT().
74 InTx(gomock.Any(), &database.TxOptions{Isolation: sql.LevelRepeatableRead}).
75 Times(5).
76 Return(&pq.Error{Code: pq.ErrorCode("40001")})
77 err := database.ReadModifyUpdate(mDB, func(tx database.Store) error {
78 return nil
79 })
80 require.ErrorContains(t, err, "too many errors")
81}

Callers

nothing calls this directly

Calls 4

EXPECTMethod · 0.95
NewMockStoreFunction · 0.92
ReadModifyUpdateFunction · 0.92
InTxMethod · 0.65

Tested by

no test coverage detected