@@ -10,15 +10,15 @@ import {
10
10
import { trace } from "@opentelemetry/api" ;
11
11
import { EnvQueues } from "~/v3/marqs/types.js" ;
12
12
import { MARQS_RESUME_PRIORITY_TIMESTAMP_OFFSET } from "~/v3/marqs/constants.server.js" ;
13
- import Redis from "ioredis " ;
13
+ import { createRedisClient } from "@internal/redis " ;
14
14
15
15
const tracer = trace . getTracer ( "test" ) ;
16
16
17
17
vi . setConfig ( { testTimeout : 30_000 } ) ; // 30 seconds timeout
18
18
19
19
describe ( "FairDequeuingStrategy" , ( ) => {
20
20
redisTest ( "should distribute a single queue from a single env" , async ( { redisOptions } ) => {
21
- const redis = new Redis ( redisOptions ) ;
21
+ const redis = createRedisClient ( redisOptions ) ;
22
22
23
23
const keyProducer = createKeyProducer ( "test" ) ;
24
24
const strategy = new FairDequeuingStrategy ( {
@@ -50,7 +50,7 @@ describe("FairDequeuingStrategy", () => {
50
50
} ) ;
51
51
52
52
redisTest ( "should respect env concurrency limits" , async ( { redisOptions } ) => {
53
- const redis = new Redis ( redisOptions ) ;
53
+ const redis = createRedisClient ( redisOptions ) ;
54
54
55
55
const keyProducer = createKeyProducer ( "test" ) ;
56
56
const strategy = new FairDequeuingStrategy ( {
@@ -85,7 +85,7 @@ describe("FairDequeuingStrategy", () => {
85
85
redisTest (
86
86
"should give extra concurrency when the env has reserve concurrency" ,
87
87
async ( { redisOptions } ) => {
88
- const redis = new Redis ( redisOptions ) ;
88
+ const redis = createRedisClient ( redisOptions ) ;
89
89
90
90
const keyProducer = createKeyProducer ( "test" ) ;
91
91
const strategy = new FairDequeuingStrategy ( {
@@ -126,7 +126,7 @@ describe("FairDequeuingStrategy", () => {
126
126
) ;
127
127
128
128
redisTest ( "should respect parentQueueLimit" , async ( { redisOptions } ) => {
129
- const redis = new Redis ( redisOptions ) ;
129
+ const redis = createRedisClient ( redisOptions ) ;
130
130
131
131
const keyProducer = createKeyProducer ( "test" ) ;
132
132
const strategy = new FairDequeuingStrategy ( {
@@ -185,7 +185,7 @@ describe("FairDequeuingStrategy", () => {
185
185
redisTest (
186
186
"should reuse snapshots across calls for the same consumer" ,
187
187
async ( { redisOptions } ) => {
188
- const redis = new Redis ( redisOptions ) ;
188
+ const redis = createRedisClient ( redisOptions ) ;
189
189
190
190
const keyProducer = createKeyProducer ( "test" ) ;
191
191
const strategy = new FairDequeuingStrategy ( {
@@ -282,7 +282,7 @@ describe("FairDequeuingStrategy", () => {
282
282
redisTest (
283
283
"should fairly distribute queues across environments over time" ,
284
284
async ( { redisOptions } ) => {
285
- const redis = new Redis ( redisOptions ) ;
285
+ const redis = createRedisClient ( redisOptions ) ;
286
286
287
287
const keyProducer = createKeyProducer ( "test" ) ;
288
288
const strategy = new FairDequeuingStrategy ( {
@@ -441,7 +441,7 @@ describe("FairDequeuingStrategy", () => {
441
441
redisTest (
442
442
"should shuffle environments while maintaining age order within environments" ,
443
443
async ( { redisOptions } ) => {
444
- const redis = new Redis ( redisOptions ) ;
444
+ const redis = createRedisClient ( redisOptions ) ;
445
445
446
446
const keyProducer = createKeyProducer ( "test" ) ;
447
447
const strategy = new FairDequeuingStrategy ( {
@@ -545,7 +545,7 @@ describe("FairDequeuingStrategy", () => {
545
545
redisTest (
546
546
"should bias shuffling based on concurrency limits and available capacity" ,
547
547
async ( { redisOptions } ) => {
548
- const redis = new Redis ( redisOptions ) ;
548
+ const redis = createRedisClient ( redisOptions ) ;
549
549
550
550
const keyProducer = createKeyProducer ( "test" ) ;
551
551
const now = Date . now ( ) ;
@@ -676,7 +676,7 @@ describe("FairDequeuingStrategy", () => {
676
676
redisTest (
677
677
"should respect ageInfluence parameter for queue ordering" ,
678
678
async ( { redisOptions } ) => {
679
- const redis = new Redis ( redisOptions ) ;
679
+ const redis = createRedisClient ( redisOptions ) ;
680
680
681
681
const keyProducer = createKeyProducer ( "test" ) ;
682
682
const now = Date . now ( ) ;
@@ -774,7 +774,7 @@ describe("FairDequeuingStrategy", () => {
774
774
redisTest (
775
775
"should respect maximumEnvCount and select envs based on queue ages" ,
776
776
async ( { redisOptions } ) => {
777
- const redis = new Redis ( redisOptions ) ;
777
+ const redis = createRedisClient ( redisOptions ) ;
778
778
779
779
const keyProducer = createKeyProducer ( "test" ) ;
780
780
const strategy = new FairDequeuingStrategy ( {
@@ -905,7 +905,7 @@ describe("FairDequeuingStrategy", () => {
905
905
redisTest (
906
906
"should not overly bias picking environments when queue have priority offset ages" ,
907
907
async ( { redisOptions } ) => {
908
- const redis = new Redis ( redisOptions ) ;
908
+ const redis = createRedisClient ( redisOptions ) ;
909
909
910
910
const keyProducer = createKeyProducer ( "test" ) ;
911
911
const strategy = new FairDequeuingStrategy ( {
0 commit comments