@@ -1035,7 +1035,7 @@ describe(DBTransaction.name, () => {
1035
1035
) ;
1036
1036
await db . withTransactionF ( async ( tran2 ) => {
1037
1037
await tran2 . lock ( [ 'foo' , 'read' ] ) ;
1038
- await expect ( tran2 . lock ( [ 'bar' , 'write' , 0 ] ) ) . rejects . toThrow (
1038
+ await expect ( tran2 . lock ( [ 'bar' , 'write' , { timer : 0 } ] ) ) . rejects . toThrow (
1039
1039
locksErrors . ErrorAsyncLocksTimeout ,
1040
1040
) ;
1041
1041
expect ( tran1 . locks . size ) . toBe ( 2 ) ;
@@ -1097,7 +1097,7 @@ describe(DBTransaction.name, () => {
1097
1097
// This is a noop, because `tran1` owns `key1` and `key2`
1098
1098
await tran2 . unlock ( 'key1' , 'key2' ) ;
1099
1099
// This fails because `key1` is still locked by `tran1`
1100
- await expect ( tran2 . lock ( [ 'key1' , 'write' , 0 ] ) ) . rejects . toThrow (
1100
+ await expect ( tran2 . lock ( [ 'key1' , 'write' , { timer : 0 } ] ) ) . rejects . toThrow (
1101
1101
locksErrors . ErrorAsyncLocksTimeout ,
1102
1102
) ;
1103
1103
await tran1 . unlock ( 'key1' ) ;
@@ -1109,7 +1109,7 @@ describe(DBTransaction.name, () => {
1109
1109
await tran1 . unlock ( 'key1' ) ;
1110
1110
expect ( tran2 . locks . has ( 'key1' ) ) . toBe ( true ) ;
1111
1111
expect ( tran1 . locks . has ( 'key1' ) ) . toBe ( false ) ;
1112
- await expect ( tran1 . lock ( [ 'key1' , 'write' , 0 ] ) ) . rejects . toThrow (
1112
+ await expect ( tran1 . lock ( [ 'key1' , 'write' , { timer : 0 } ] ) ) . rejects . toThrow (
1113
1113
locksErrors . ErrorAsyncLocksTimeout ,
1114
1114
) ;
1115
1115
} ) ;
@@ -1126,8 +1126,8 @@ describe(DBTransaction.name, () => {
1126
1126
// Currently a deadlock can happen, and the only way to avoid is to use timeouts
1127
1127
// In the future, we want to have `DBTransaction` detect deadlocks
1128
1128
// and automatically give us `ErrorDBTransactionDeadlock` exception
1129
- const p1 = tran1 . lock ( [ 'bar' , 'write' , 50 ] ) ;
1130
- const p2 = tran2 . lock ( [ 'foo' , 'write' , 50 ] ) ;
1129
+ const p1 = tran1 . lock ( [ 'bar' , 'write' , { timer : 50 } ] ) ;
1130
+ const p2 = tran2 . lock ( [ 'foo' , 'write' , { timer : 50 } ] ) ;
1131
1131
const results = await Promise . allSettled ( [ p1 , p2 ] ) ;
1132
1132
expect (
1133
1133
results . every (
0 commit comments