@@ -330,57 +330,6 @@ func TestProbing_Worker_ContextCancelIsNoop(t *testing.T) {
330330 require .True (t , hasRouteLiveness (w , r , LivenessStatusDown , 0 , 0 ))
331331}
332332
333- func TestProbing_Worker_ListenRetry_UntilContextDone (t * testing.T ) {
334- t .Parallel ()
335-
336- fourthStarted := make (chan struct {}, 1 )
337- var listenCalls atomic.Int64
338-
339- sched := newFakeScheduler ()
340- cfg := newTestConfig (t , func (c * Config ) {
341- c .Liveness = seqPolicy ([]LivenessTransition {LivenessTransitionNoChange })
342- c .ProbeFunc = func (context.Context , * routing.Route ) (ProbeResult , error ) { return ProbeResult {OK : true }, nil }
343- c .ListenFunc = func (ctx context.Context ) error {
344- n := listenCalls .Add (1 )
345- if n <= 3 {
346- return errors .New ("synthetic listen error" )
347- }
348- select {
349- case fourthStarted <- struct {}{}:
350- default :
351- }
352- <- ctx .Done ()
353- return nil
354- }
355- c .ListenBackoff = ListenBackoffConfig {Initial : time .Millisecond , Max : time .Millisecond , Multiplier : 1 }
356- c .Limiter , _ = NewSemaphoreLimiter (2 )
357- c .Scheduler = sched
358- })
359-
360- w := newWorker (cfg .Logger , cfg , newRouteStore ())
361- r := newTestRouteWithDst (net .IPv4 (10 , 0 , 5 , 10 ))
362- rk := newRouteKey (r )
363- w .store .Set (rk , managedRoute {route : r , liveness : cfg .Liveness .NewTracker ()})
364- sched .Add (rk , time .Now ())
365-
366- w .Start (cfg .Context )
367- t .Cleanup (w .Stop )
368-
369- requireEventuallyDump (t , func () bool { return w .IsRunning () }, 2 * time .Second , 10 * time .Millisecond , "worker did not start" )
370-
371- // Wait until the 4th listen attempt has occurred
372- requireEventuallyDump (t , func () bool {
373- select {
374- case <- fourthStarted :
375- return true
376- default :
377- return false
378- }
379- }, 5 * time .Second , 5 * time .Millisecond , "4th listen attempt did not start" )
380-
381- require .True (t , w .IsRunning ())
382- }
383-
384333func TestProbing_Worker_KernelError_DoesNotBlockStateAdvance (t * testing.T ) {
385334 t .Parallel ()
386335
0 commit comments