@@ -41,7 +41,7 @@ func TestEventDrivenHandoffIntegration(t *testing.T) {
4141 }
4242
4343 // Create processor with event-driven handoff support
44- processor := hitless .NewPoolHook (3 , baseDialer , nil , nil )
44+ processor := hitless .NewPoolHook (baseDialer , nil , nil )
4545 defer processor .Shutdown (context .Background ())
4646
4747 // Create a test pool with hooks
@@ -52,10 +52,12 @@ func TestEventDrivenHandoffIntegration(t *testing.T) {
5252 Dialer : func (ctx context.Context ) (net.Conn , error ) {
5353 return & mockNetConn {addr : "original:6379" }, nil
5454 },
55- PoolHooks : hookManager ,
56- PoolSize : 5 ,
57- PoolTimeout : time .Second ,
55+ PoolSize : 5 ,
56+ PoolTimeout : time .Second ,
5857 })
58+
59+ // Add the hook to the pool after creation
60+ testPool .AddPoolHook (processor )
5961 defer testPool .Close ()
6062
6163 // Set the pool reference in the processor for connection removal on handoff failure
@@ -131,7 +133,7 @@ func TestEventDrivenHandoffIntegration(t *testing.T) {
131133 return & mockNetConn {addr : addr }, nil
132134 }
133135
134- processor := hitless .NewPoolHook (3 , baseDialer , nil , nil )
136+ processor := hitless .NewPoolHook (baseDialer , nil , nil )
135137 defer processor .Shutdown (context .Background ())
136138
137139 // Create hooks manager and add processor as hook
@@ -142,12 +144,15 @@ func TestEventDrivenHandoffIntegration(t *testing.T) {
142144 Dialer : func (ctx context.Context ) (net.Conn , error ) {
143145 return & mockNetConn {addr : "original:6379" }, nil
144146 },
145- PoolHooks : hookManager ,
147+
146148 PoolSize : 10 ,
147149 PoolTimeout : time .Second ,
148150 })
149151 defer testPool .Close ()
150152
153+ // Add the hook to the pool after creation
154+ testPool .AddPoolHook (processor )
155+
151156 // Set the pool reference in the processor
152157 processor .SetPool (testPool )
153158
@@ -200,7 +205,7 @@ func TestEventDrivenHandoffIntegration(t *testing.T) {
200205 return nil , & net.OpError {Op : "dial" , Err : & net.DNSError {Name : addr }}
201206 }
202207
203- processor := hitless .NewPoolHook (3 , failingDialer , nil , nil )
208+ processor := hitless .NewPoolHook (failingDialer , nil , nil )
204209 defer processor .Shutdown (context .Background ())
205210
206211 // Create hooks manager and add processor as hook
@@ -211,12 +216,15 @@ func TestEventDrivenHandoffIntegration(t *testing.T) {
211216 Dialer : func (ctx context.Context ) (net.Conn , error ) {
212217 return & mockNetConn {addr : "original:6379" }, nil
213218 },
214- PoolHooks : hookManager ,
219+
215220 PoolSize : 3 ,
216221 PoolTimeout : time .Second ,
217222 })
218223 defer testPool .Close ()
219224
225+ // Add the hook to the pool after creation
226+ testPool .AddPoolHook (processor )
227+
220228 // Set the pool reference in the processor
221229 processor .SetPool (testPool )
222230
@@ -260,7 +268,7 @@ func TestEventDrivenHandoffIntegration(t *testing.T) {
260268 return & mockNetConn {addr : addr }, nil
261269 }
262270
263- processor := hitless .NewPoolHook (3 , slowDialer , nil , nil )
271+ processor := hitless .NewPoolHook (slowDialer , nil , nil )
264272
265273 // Create hooks manager and add processor as hook
266274 hookManager := pool .NewPoolHookManager ()
@@ -270,12 +278,15 @@ func TestEventDrivenHandoffIntegration(t *testing.T) {
270278 Dialer : func (ctx context.Context ) (net.Conn , error ) {
271279 return & mockNetConn {addr : "original:6379" }, nil
272280 },
273- PoolHooks : hookManager ,
281+
274282 PoolSize : 2 ,
275283 PoolTimeout : time .Second ,
276284 })
277285 defer testPool .Close ()
278286
287+ // Add the hook to the pool after creation
288+ testPool .AddPoolHook (processor )
289+
279290 // Set the pool reference in the processor
280291 processor .SetPool (testPool )
281292
0 commit comments