Skip to content

Commit 8c31505

Browse files
committed
fix tests
1 parent 94a55cb commit 8c31505

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

storage/operation/children_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,18 @@ func TestChildrenWrongLockIsRejected(t *testing.T) {
254254

255255
parentID := unittest.IdentifierFixture()
256256
childID := unittest.IdentifierFixture()
257-
err := unittest.WithLock(t, lockManager, storage.LockInsertBlock, func(lctx lockctx.Context) error {
257+
258+
// Use the wrong lock type for each operation
259+
var wrongLockType string
260+
if opPair.lockType == storage.LockInsertBlock {
261+
// For IndexNewBlock, use the cluster block lock (wrong)
262+
wrongLockType = storage.LockInsertOrFinalizeClusterBlock
263+
} else {
264+
// For IndexNewClusterBlock, use the regular block lock (wrong)
265+
wrongLockType = storage.LockInsertBlock
266+
}
267+
268+
err := unittest.WithLock(t, lockManager, wrongLockType, func(lctx lockctx.Context) error {
258269
return db.WithReaderBatchWriter(func(rw storage.ReaderBatchWriter) error {
259270
return opPair.indexFunc(lctx, rw, childID, parentID)
260271
})

0 commit comments

Comments
 (0)