@@ -10,15 +10,15 @@ import {
1010import { trace } from "@opentelemetry/api" ;
1111import { EnvQueues } from "~/v3/marqs/types.js" ;
1212import { MARQS_RESUME_PRIORITY_TIMESTAMP_OFFSET } from "~/v3/marqs/constants.server.js" ;
13- import Redis from "ioredis " ;
13+ import { createRedisClient } from "@internal/redis " ;
1414
1515const tracer = trace . getTracer ( "test" ) ;
1616
1717vi . setConfig ( { testTimeout : 30_000 } ) ; // 30 seconds timeout
1818
1919describe ( "FairDequeuingStrategy" , ( ) => {
2020 redisTest ( "should distribute a single queue from a single env" , async ( { redisOptions } ) => {
21- const redis = new Redis ( redisOptions ) ;
21+ const redis = createRedisClient ( redisOptions ) ;
2222
2323 const keyProducer = createKeyProducer ( "test" ) ;
2424 const strategy = new FairDequeuingStrategy ( {
@@ -50,7 +50,7 @@ describe("FairDequeuingStrategy", () => {
5050 } ) ;
5151
5252 redisTest ( "should respect env concurrency limits" , async ( { redisOptions } ) => {
53- const redis = new Redis ( redisOptions ) ;
53+ const redis = createRedisClient ( redisOptions ) ;
5454
5555 const keyProducer = createKeyProducer ( "test" ) ;
5656 const strategy = new FairDequeuingStrategy ( {
@@ -85,7 +85,7 @@ describe("FairDequeuingStrategy", () => {
8585 redisTest (
8686 "should give extra concurrency when the env has reserve concurrency" ,
8787 async ( { redisOptions } ) => {
88- const redis = new Redis ( redisOptions ) ;
88+ const redis = createRedisClient ( redisOptions ) ;
8989
9090 const keyProducer = createKeyProducer ( "test" ) ;
9191 const strategy = new FairDequeuingStrategy ( {
@@ -126,7 +126,7 @@ describe("FairDequeuingStrategy", () => {
126126 ) ;
127127
128128 redisTest ( "should respect parentQueueLimit" , async ( { redisOptions } ) => {
129- const redis = new Redis ( redisOptions ) ;
129+ const redis = createRedisClient ( redisOptions ) ;
130130
131131 const keyProducer = createKeyProducer ( "test" ) ;
132132 const strategy = new FairDequeuingStrategy ( {
@@ -185,7 +185,7 @@ describe("FairDequeuingStrategy", () => {
185185 redisTest (
186186 "should reuse snapshots across calls for the same consumer" ,
187187 async ( { redisOptions } ) => {
188- const redis = new Redis ( redisOptions ) ;
188+ const redis = createRedisClient ( redisOptions ) ;
189189
190190 const keyProducer = createKeyProducer ( "test" ) ;
191191 const strategy = new FairDequeuingStrategy ( {
@@ -282,7 +282,7 @@ describe("FairDequeuingStrategy", () => {
282282 redisTest (
283283 "should fairly distribute queues across environments over time" ,
284284 async ( { redisOptions } ) => {
285- const redis = new Redis ( redisOptions ) ;
285+ const redis = createRedisClient ( redisOptions ) ;
286286
287287 const keyProducer = createKeyProducer ( "test" ) ;
288288 const strategy = new FairDequeuingStrategy ( {
@@ -441,7 +441,7 @@ describe("FairDequeuingStrategy", () => {
441441 redisTest (
442442 "should shuffle environments while maintaining age order within environments" ,
443443 async ( { redisOptions } ) => {
444- const redis = new Redis ( redisOptions ) ;
444+ const redis = createRedisClient ( redisOptions ) ;
445445
446446 const keyProducer = createKeyProducer ( "test" ) ;
447447 const strategy = new FairDequeuingStrategy ( {
@@ -545,7 +545,7 @@ describe("FairDequeuingStrategy", () => {
545545 redisTest (
546546 "should bias shuffling based on concurrency limits and available capacity" ,
547547 async ( { redisOptions } ) => {
548- const redis = new Redis ( redisOptions ) ;
548+ const redis = createRedisClient ( redisOptions ) ;
549549
550550 const keyProducer = createKeyProducer ( "test" ) ;
551551 const now = Date . now ( ) ;
@@ -676,7 +676,7 @@ describe("FairDequeuingStrategy", () => {
676676 redisTest (
677677 "should respect ageInfluence parameter for queue ordering" ,
678678 async ( { redisOptions } ) => {
679- const redis = new Redis ( redisOptions ) ;
679+ const redis = createRedisClient ( redisOptions ) ;
680680
681681 const keyProducer = createKeyProducer ( "test" ) ;
682682 const now = Date . now ( ) ;
@@ -774,7 +774,7 @@ describe("FairDequeuingStrategy", () => {
774774 redisTest (
775775 "should respect maximumEnvCount and select envs based on queue ages" ,
776776 async ( { redisOptions } ) => {
777- const redis = new Redis ( redisOptions ) ;
777+ const redis = createRedisClient ( redisOptions ) ;
778778
779779 const keyProducer = createKeyProducer ( "test" ) ;
780780 const strategy = new FairDequeuingStrategy ( {
@@ -905,7 +905,7 @@ describe("FairDequeuingStrategy", () => {
905905 redisTest (
906906 "should not overly bias picking environments when queue have priority offset ages" ,
907907 async ( { redisOptions } ) => {
908- const redis = new Redis ( redisOptions ) ;
908+ const redis = createRedisClient ( redisOptions ) ;
909909
910910 const keyProducer = createKeyProducer ( "test" ) ;
911911 const strategy = new FairDequeuingStrategy ( {
0 commit comments