@@ -833,7 +833,7 @@ func rateLimiterTestWorkflow(ctx DBOSContext, _ string) (time.Time, error) {
833833func TestQueueRateLimiter (t * testing.T ) {
834834 dbosCtx := setupDBOS (t , true , true )
835835
836- rateLimiterQueue := NewWorkflowQueue (dbosCtx , "test-rate-limiter-queue" , WithRateLimiter (& RateLimiter {Limit : 5 , Period : 1.8 }))
836+ rateLimiterQueue := NewWorkflowQueue (dbosCtx , "test-rate-limiter-queue" , WithRateLimiter (& RateLimiter {Limit : 5 , Period : time . Duration ( 1800 * time . Millisecond ) }))
837837
838838 // Create workflow with dbosContext
839839 RegisterWorkflow (dbosCtx , rateLimiterTestWorkflow )
@@ -842,7 +842,7 @@ func TestQueueRateLimiter(t *testing.T) {
842842 require .NoError (t , err , "failed to launch DBOS instance" )
843843
844844 limit := 5
845- period := 1.8
845+ periodSeconds := 1.8
846846 numWaves := 3
847847
848848 var handles []WorkflowHandle [time.Time ]
@@ -889,7 +889,7 @@ func TestQueueRateLimiter(t *testing.T) {
889889 // Group workflows into waves based on their start time
890890 for _ , workflowTime := range sortedTimes {
891891 timeSinceBase := workflowTime .Sub (baseTime ).Seconds ()
892- waveIndex := int (timeSinceBase / period )
892+ waveIndex := int (timeSinceBase / periodSeconds )
893893 waveMap [waveIndex ] = append (waveMap [waveIndex ], workflowTime )
894894 }
895895 // Verify each wave has fewer than the limit
0 commit comments