@@ -115,7 +115,7 @@ describe("RunLocker", () => {
115
115
logger,
116
116
tracer : trace . getTracer ( "RunLockTest" ) ,
117
117
retryConfig : {
118
- maxRetries : 3 ,
118
+ maxAttempts : 3 ,
119
119
baseDelay : 100 ,
120
120
maxTotalWaitTime : 2000 , // 2 second timeout for faster test
121
121
} ,
@@ -246,7 +246,7 @@ describe("RunLocker", () => {
246
246
logger,
247
247
tracer : trace . getTracer ( "RunLockTest" ) ,
248
248
retryConfig : {
249
- maxRetries : 2 ,
249
+ maxAttempts : 2 ,
250
250
baseDelay : 50 ,
251
251
maxDelay : 200 ,
252
252
backoffMultiplier : 2.0 ,
@@ -258,7 +258,7 @@ describe("RunLocker", () => {
258
258
try {
259
259
// Verify configuration is set correctly
260
260
const config = runLock . getRetryConfig ( ) ;
261
- expect ( config . maxRetries ) . toBe ( 2 ) ;
261
+ expect ( config . maxAttempts ) . toBe ( 2 ) ;
262
262
expect ( config . baseDelay ) . toBe ( 50 ) ;
263
263
expect ( config . maxDelay ) . toBe ( 200 ) ;
264
264
expect ( config . backoffMultiplier ) . toBe ( 2.0 ) ;
@@ -288,7 +288,7 @@ describe("RunLocker", () => {
288
288
logger,
289
289
tracer : trace . getTracer ( "RunLockTest" ) ,
290
290
retryConfig : {
291
- maxRetries : 2 ,
291
+ maxAttempts : 2 ,
292
292
baseDelay : 50 ,
293
293
maxTotalWaitTime : 500 , // Shorter timeout to ensure failure
294
294
} ,
@@ -315,7 +315,7 @@ describe("RunLocker", () => {
315
315
if ( error instanceof LockAcquisitionTimeoutError ) {
316
316
expect ( error . resources ) . toEqual ( [ "test-error" ] ) ;
317
317
expect ( error . attempts ) . toBeGreaterThan ( 0 ) ;
318
- expect ( error . attempts ) . toBeLessThanOrEqual ( 3 ) ; // maxRetries + 1
318
+ expect ( error . attempts ) . toBeLessThanOrEqual ( 3 ) ; // maxAttempts + 1
319
319
expect ( error . totalWaitTime ) . toBeGreaterThan ( 0 ) ;
320
320
expect ( error . totalWaitTime ) . toBeLessThanOrEqual ( 800 ) ; // Some tolerance
321
321
expect ( error . name ) . toBe ( "LockAcquisitionTimeoutError" ) ;
@@ -344,7 +344,7 @@ describe("RunLocker", () => {
344
344
345
345
try {
346
346
const config = runLock . getRetryConfig ( ) ;
347
- expect ( config . maxRetries ) . toBe ( 10 ) ;
347
+ expect ( config . maxAttempts ) . toBe ( 10 ) ;
348
348
expect ( config . baseDelay ) . toBe ( 200 ) ;
349
349
expect ( config . maxDelay ) . toBe ( 5000 ) ;
350
350
expect ( config . backoffMultiplier ) . toBe ( 1.5 ) ;
@@ -371,15 +371,15 @@ describe("RunLocker", () => {
371
371
logger,
372
372
tracer : trace . getTracer ( "RunLockTest" ) ,
373
373
retryConfig : {
374
- maxRetries : 5 ,
374
+ maxAttempts : 5 ,
375
375
maxTotalWaitTime : 10000 ,
376
376
// Other values should use defaults
377
377
} ,
378
378
} ) ;
379
379
380
380
try {
381
381
const config = runLock . getRetryConfig ( ) ;
382
- expect ( config . maxRetries ) . toBe ( 5 ) ; // Overridden
382
+ expect ( config . maxAttempts ) . toBe ( 5 ) ; // Overridden
383
383
expect ( config . maxTotalWaitTime ) . toBe ( 10000 ) ; // Overridden
384
384
expect ( config . baseDelay ) . toBe ( 200 ) ; // Default
385
385
expect ( config . maxDelay ) . toBe ( 5000 ) ; // Default
@@ -643,7 +643,7 @@ describe("RunLocker", () => {
643
643
duration : 3000 ,
644
644
automaticExtensionThreshold : 300 ,
645
645
retryConfig : {
646
- maxRetries : 5 ,
646
+ maxAttempts : 5 ,
647
647
baseDelay : 150 ,
648
648
} ,
649
649
} ) ;
@@ -654,7 +654,7 @@ describe("RunLocker", () => {
654
654
expect ( runLock . getAutomaticExtensionThreshold ( ) ) . toBe ( 300 ) ;
655
655
656
656
const retryConfig = runLock . getRetryConfig ( ) ;
657
- expect ( retryConfig . maxRetries ) . toBe ( 5 ) ;
657
+ expect ( retryConfig . maxAttempts ) . toBe ( 5 ) ;
658
658
expect ( retryConfig . baseDelay ) . toBe ( 150 ) ;
659
659
660
660
// Test basic functionality with all custom configs
@@ -681,7 +681,7 @@ describe("RunLocker", () => {
681
681
duration : 10000 ,
682
682
automaticExtensionThreshold : 2000 ,
683
683
retryConfig : {
684
- maxRetries : 15 ,
684
+ maxAttempts : 15 ,
685
685
baseDelay : 100 ,
686
686
maxDelay : 3000 ,
687
687
backoffMultiplier : 1.8 ,
@@ -696,7 +696,7 @@ describe("RunLocker", () => {
696
696
expect ( runLock . getAutomaticExtensionThreshold ( ) ) . toBe ( 2000 ) ;
697
697
698
698
const retryConfig = runLock . getRetryConfig ( ) ;
699
- expect ( retryConfig . maxRetries ) . toBe ( 15 ) ;
699
+ expect ( retryConfig . maxAttempts ) . toBe ( 15 ) ;
700
700
expect ( retryConfig . baseDelay ) . toBe ( 100 ) ;
701
701
expect ( retryConfig . maxDelay ) . toBe ( 3000 ) ;
702
702
expect ( retryConfig . backoffMultiplier ) . toBe ( 1.8 ) ;
@@ -722,22 +722,22 @@ describe("RunLocker", () => {
722
722
redisTest ( "Test configuration edge cases" , { timeout : 15_000 } , async ( { redisOptions } ) => {
723
723
const logger = new Logger ( "RunLockTest" , "debug" ) ;
724
724
725
- // Test with maxRetries = 0
725
+ // Test with maxAttempts = 0
726
726
const redis1 = createRedisClient ( redisOptions ) ;
727
727
const runLock1 = new RunLocker ( {
728
728
redis : redis1 ,
729
729
logger,
730
730
tracer : trace . getTracer ( "RunLockTest" ) ,
731
731
retryConfig : {
732
- maxRetries : 0 ,
732
+ maxAttempts : 0 ,
733
733
baseDelay : 100 ,
734
734
maxTotalWaitTime : 1000 ,
735
735
} ,
736
736
} ) ;
737
737
738
738
try {
739
739
const config = runLock1 . getRetryConfig ( ) ;
740
- expect ( config . maxRetries ) . toBe ( 0 ) ;
740
+ expect ( config . maxAttempts ) . toBe ( 0 ) ;
741
741
742
742
// Should work for successful acquisitions
743
743
await runLock1 . lock ( "test-lock" , [ "test-edge" ] , async ( ) => {
@@ -754,7 +754,7 @@ describe("RunLocker", () => {
754
754
logger,
755
755
tracer : trace . getTracer ( "RunLockTest" ) ,
756
756
retryConfig : {
757
- maxRetries : 2 ,
757
+ maxAttempts : 2 ,
758
758
baseDelay : 1 ,
759
759
maxDelay : 10 ,
760
760
backoffMultiplier : 2.0 ,
@@ -785,7 +785,7 @@ describe("RunLocker", () => {
785
785
logger,
786
786
tracer : trace . getTracer ( "RunLockTest" ) ,
787
787
retryConfig : {
788
- maxRetries : 100 , // High retry count
788
+ maxAttempts : 100 , // High retry count
789
789
baseDelay : 100 ,
790
790
maxTotalWaitTime : 500 , // But low total wait time
791
791
} ,
@@ -794,7 +794,7 @@ describe("RunLocker", () => {
794
794
try {
795
795
// Test that total wait time configuration is properly applied
796
796
const config = runLock . getRetryConfig ( ) ;
797
- expect ( config . maxRetries ) . toBe ( 100 ) ;
797
+ expect ( config . maxAttempts ) . toBe ( 100 ) ;
798
798
expect ( config . maxTotalWaitTime ) . toBe ( 500 ) ;
799
799
expect ( config . baseDelay ) . toBe ( 100 ) ;
800
800
@@ -946,7 +946,7 @@ describe("RunLocker", () => {
946
946
tracer : trace . getTracer ( "RunLockTest" ) ,
947
947
duration : 30000 ,
948
948
retryConfig : {
949
- maxRetries : 3 ,
949
+ maxAttempts : 3 ,
950
950
baseDelay : 100 ,
951
951
maxDelay : 500 ,
952
952
backoffMultiplier : 2.0 ,
0 commit comments