@@ -67,7 +67,7 @@ func TestIndexChunkDataPackByChunkID(t *testing.T) {
6767 chunkDataPackID := unittest .IdentifierFixture ()
6868
6969 t .Run ("successful insert" , func (t * testing.T ) {
70- err := unittest .WithLock (t , lockManager , storage .LockInsertOwnReceipt , func (lctx lockctx.Context ) error {
70+ err := unittest .WithLock (t , lockManager , storage .LockIndexChunkDataPackByChunkID , func (lctx lockctx.Context ) error {
7171 return db .WithReaderBatchWriter (func (rw storage.ReaderBatchWriter ) error {
7272 return operation .IndexChunkDataPackByChunkID (lctx , rw , chunkID , chunkDataPackID )
7373 })
@@ -83,7 +83,7 @@ func TestIndexChunkDataPackByChunkID(t *testing.T) {
8383
8484 t .Run ("idempotent insert" , func (t * testing.T ) {
8585 // Insert the same chunk data pack ID again should be idempotent
86- err := unittest .WithLock (t , lockManager , storage .LockInsertOwnReceipt , func (lctx lockctx.Context ) error {
86+ err := unittest .WithLock (t , lockManager , storage .LockIndexChunkDataPackByChunkID , func (lctx lockctx.Context ) error {
8787 return db .WithReaderBatchWriter (func (rw storage.ReaderBatchWriter ) error {
8888 return operation .IndexChunkDataPackByChunkID (lctx , rw , chunkID , chunkDataPackID )
8989 })
@@ -100,7 +100,7 @@ func TestIndexChunkDataPackByChunkID(t *testing.T) {
100100 t .Run ("data mismatch error" , func (t * testing.T ) {
101101 differentStoredChunkDataPackID := unittest .IdentifierFixture ()
102102
103- err := unittest .WithLock (t , lockManager , storage .LockInsertOwnReceipt , func (lctx lockctx.Context ) error {
103+ err := unittest .WithLock (t , lockManager , storage .LockIndexChunkDataPackByChunkID , func (lctx lockctx.Context ) error {
104104 return db .WithReaderBatchWriter (func (rw storage.ReaderBatchWriter ) error {
105105 return operation .IndexChunkDataPackByChunkID (lctx , rw , chunkID , differentStoredChunkDataPackID )
106106 })
@@ -130,7 +130,7 @@ func TestIndexChunkDataPackByChunkID(t *testing.T) {
130130 require .Error (t , err )
131131 require .NotErrorIs (t , err , storage .ErrDataMismatch ) // missing lock should not be erroneously represented as mismatching data
132132 assert .Contains (t , err .Error (), "missing required lock" )
133- assert .Contains (t , err .Error (), storage .LockInsertOwnReceipt )
133+ assert .Contains (t , err .Error (), storage .LockIndexChunkDataPackByChunkID )
134134 })
135135
136136 t .Run ("wrong lock type" , func (t * testing.T ) {
@@ -146,7 +146,7 @@ func TestIndexChunkDataPackByChunkID(t *testing.T) {
146146 require .Error (t , err )
147147 require .NotErrorIs (t , err , storage .ErrDataMismatch ) // wrong lock should not be erroneously represented as mismatching data
148148 assert .Contains (t , err .Error (), "missing required lock" )
149- assert .Contains (t , err .Error (), storage .LockInsertOwnReceipt )
149+ assert .Contains (t , err .Error (), storage .LockIndexChunkDataPackByChunkID )
150150 })
151151 })
152152}
@@ -169,7 +169,7 @@ func TestRetrieveChunkDataPackID(t *testing.T) {
169169
170170 t .Run ("retrieve existing" , func (t * testing.T ) {
171171 // First insert a chunk data pack ID
172- err := unittest .WithLock (t , lockManager , storage .LockInsertOwnReceipt , func (lctx lockctx.Context ) error {
172+ err := unittest .WithLock (t , lockManager , storage .LockIndexChunkDataPackByChunkID , func (lctx lockctx.Context ) error {
173173 return db .WithReaderBatchWriter (func (rw storage.ReaderBatchWriter ) error {
174174 return operation .IndexChunkDataPackByChunkID (lctx , rw , chunkID , chunkDataPackID )
175175 })
@@ -185,7 +185,7 @@ func TestRetrieveChunkDataPackID(t *testing.T) {
185185
186186 t .Run ("retrieve after removal" , func (t * testing.T ) {
187187 // Insert a chunk data pack ID
188- err := unittest .WithLock (t , lockManager , storage .LockInsertOwnReceipt , func (lctx lockctx.Context ) error {
188+ err := unittest .WithLock (t , lockManager , storage .LockIndexChunkDataPackByChunkID , func (lctx lockctx.Context ) error {
189189 return db .WithReaderBatchWriter (func (rw storage.ReaderBatchWriter ) error {
190190 return operation .IndexChunkDataPackByChunkID (lctx , rw , chunkID , chunkDataPackID )
191191 })
@@ -224,7 +224,7 @@ func TestRemoveChunkDataPackID(t *testing.T) {
224224
225225 t .Run ("remove existing" , func (t * testing.T ) {
226226 // First insert a chunk data pack ID
227- err := unittest .WithLock (t , lockManager , storage .LockInsertOwnReceipt , func (lctx lockctx.Context ) error {
227+ err := unittest .WithLock (t , lockManager , storage .LockIndexChunkDataPackByChunkID , func (lctx lockctx.Context ) error {
228228 return db .WithReaderBatchWriter (func (rw storage.ReaderBatchWriter ) error {
229229 return operation .IndexChunkDataPackByChunkID (lctx , rw , chunkID , chunkDataPackID )
230230 })
@@ -256,7 +256,7 @@ func TestRemoveChunkDataPackID(t *testing.T) {
256256 // Insert multiple chunk data pack IDs
257257 for i := 0 ; i < 3 ; i ++ {
258258
259- err := unittest .WithLock (t , lockManager , storage .LockInsertOwnReceipt , func (lctx lockctx.Context ) error {
259+ err := unittest .WithLock (t , lockManager , storage .LockIndexChunkDataPackByChunkID , func (lctx lockctx.Context ) error {
260260 return db .WithReaderBatchWriter (func (rw storage.ReaderBatchWriter ) error {
261261 return operation .IndexChunkDataPackByChunkID (lctx , rw , chunkIDs [i ], chunkDataPackIDs [i ])
262262 })
0 commit comments