@@ -43,10 +43,9 @@ func TestNewPubSub(t *testing.T) {
4343 conf : config.SyncConfig {
4444 Pubsub : map [string ]interface {}{
4545 "redis" : map [string ]interface {}{
46- "host" : "localhost:6379" ,
47- "password" : "" ,
48- "database" : 0 ,
49- "force_implementation" : "pubsub" , // Force Pub/Sub for deterministic test
46+ "host" : "localhost:6379" ,
47+ "password" : "" ,
48+ "database" : 0 ,
5049 },
5150 },
5251 Notification : config.FeatureSyncConfig {
@@ -56,10 +55,16 @@ func TestNewPubSub(t *testing.T) {
5655 },
5756 flag : SyncFeatureFlagNotification ,
5857 },
59- want : & pubsub.Redis {
60- Host : "localhost:6379" ,
61- Password : "" ,
62- Database : 0 ,
58+ want : & pubsub.RedisStreams {
59+ Host : "localhost:6379" ,
60+ Password : "" ,
61+ Database : 0 ,
62+ BatchSize : 10 ,
63+ FlushInterval : 5 * time .Second ,
64+ MaxRetries : 3 ,
65+ RetryDelay : 100 * time .Millisecond ,
66+ MaxRetryDelay : 5 * time .Second ,
67+ ConnTimeout : 10 * time .Second ,
6368 },
6469 wantErr : false ,
6570 },
@@ -69,10 +74,9 @@ func TestNewPubSub(t *testing.T) {
6974 conf : config.SyncConfig {
7075 Pubsub : map [string ]interface {}{
7176 "redis" : map [string ]interface {}{
72- "host" : "localhost:6379" ,
73- "password" : "" ,
74- "database" : 0 ,
75- "force_implementation" : "pubsub" , // Force Pub/Sub for deterministic test
77+ "host" : "localhost:6379" ,
78+ "password" : "" ,
79+ "database" : 0 ,
7680 },
7781 },
7882 Datafile : config.FeatureSyncConfig {
@@ -82,10 +86,16 @@ func TestNewPubSub(t *testing.T) {
8286 },
8387 flag : SyncFeatureFlagDatafile ,
8488 },
85- want : & pubsub.Redis {
86- Host : "localhost:6379" ,
87- Password : "" ,
88- Database : 0 ,
89+ want : & pubsub.RedisStreams {
90+ Host : "localhost:6379" ,
91+ Password : "" ,
92+ Database : 0 ,
93+ BatchSize : 10 ,
94+ FlushInterval : 5 * time .Second ,
95+ MaxRetries : 3 ,
96+ RetryDelay : 100 * time .Millisecond ,
97+ MaxRetryDelay : 5 * time .Second ,
98+ ConnTimeout : 10 * time .Second ,
8999 },
90100 wantErr : false ,
91101 },
@@ -187,9 +197,8 @@ func TestNewPubSub(t *testing.T) {
187197 conf : config.SyncConfig {
188198 Pubsub : map [string ]interface {}{
189199 "redis" : map [string ]interface {}{
190- "host" : "localhost:6379" ,
191- "database" : 0 ,
192- "force_implementation" : "pubsub" , // Force Pub/Sub for deterministic test
200+ "host" : "localhost:6379" ,
201+ "database" : 0 ,
193202 },
194203 },
195204 Notification : config.FeatureSyncConfig {
@@ -199,10 +208,16 @@ func TestNewPubSub(t *testing.T) {
199208 },
200209 flag : SyncFeatureFlagNotification ,
201210 },
202- want : & pubsub.Redis {
203- Host : "localhost:6379" ,
204- Password : "" , // Empty password is valid (no auth required)
205- Database : 0 ,
211+ want : & pubsub.RedisStreams {
212+ Host : "localhost:6379" ,
213+ Password : "" , // Empty password is valid (no auth required)
214+ Database : 0 ,
215+ BatchSize : 10 ,
216+ FlushInterval : 5 * time .Second ,
217+ MaxRetries : 3 ,
218+ RetryDelay : 100 * time .Millisecond ,
219+ MaxRetryDelay : 5 * time .Second ,
220+ ConnTimeout : 10 * time .Second ,
206221 },
207222 wantErr : false ,
208223 },
@@ -232,10 +247,9 @@ func TestNewPubSub(t *testing.T) {
232247 conf : config.SyncConfig {
233248 Pubsub : map [string ]interface {}{
234249 "redis" : map [string ]interface {}{
235- "host" : "localhost:6379" ,
236- "password" : 1234 , // Invalid type, will be ignored
237- "database" : 0 ,
238- "force_implementation" : "pubsub" , // Force Pub/Sub for deterministic test
250+ "host" : "localhost:6379" ,
251+ "password" : 1234 , // Invalid type, will be ignored
252+ "database" : 0 ,
239253 },
240254 },
241255 Notification : config.FeatureSyncConfig {
@@ -245,10 +259,16 @@ func TestNewPubSub(t *testing.T) {
245259 },
246260 flag : SyncFeatureFlagNotification ,
247261 },
248- want : & pubsub.Redis {
249- Host : "localhost:6379" ,
250- Password : "" , // Invalid type ignored, falls back to empty string
251- Database : 0 ,
262+ want : & pubsub.RedisStreams {
263+ Host : "localhost:6379" ,
264+ Password : "" , // Invalid type ignored, falls back to empty string
265+ Database : 0 ,
266+ BatchSize : 10 ,
267+ FlushInterval : 5 * time .Second ,
268+ MaxRetries : 3 ,
269+ RetryDelay : 100 * time .Millisecond ,
270+ MaxRetryDelay : 5 * time .Second ,
271+ ConnTimeout : 10 * time .Second ,
252272 },
253273 wantErr : false ,
254274 },
0 commit comments