@@ -1583,6 +1583,35 @@ func TestUnit_NodeLifecycle_unreachableLoop(t *testing.T) {
15831583func TestUnit_NodeLifecycle_probeUntilStable (t * testing.T ) {
15841584 t .Parallel ()
15851585
1586+ t .Run ("returns true immediately when pollInterval is zero, skipping probe" , func (t * testing.T ) {
1587+ t .Parallel ()
1588+ rpc := newMockRPCClient [ID , Head ](t )
1589+ // ClientVersion is intentionally NOT mocked: if the guard is missing the loop fires
1590+ // immediately (time.After(0)) and calls ClientVersion, which makes the test fail.
1591+ node := newTestNode (t , testNodeOpts {
1592+ rpc : rpc ,
1593+ config : testNodeConfig {
1594+ pollSuccessThreshold : 2 ,
1595+ pollInterval : 0 ,
1596+ },
1597+ })
1598+ result := node .probeUntilStable (t .Context (), logger .Test (t ))
1599+ assert .True (t , result )
1600+ })
1601+ t .Run ("returns true immediately when pollInterval is negative, skipping probe" , func (t * testing.T ) {
1602+ t .Parallel ()
1603+ rpc := newMockRPCClient [ID , Head ](t )
1604+ // ClientVersion is intentionally NOT mocked: same reasoning as above.
1605+ node := newTestNode (t , testNodeOpts {
1606+ rpc : rpc ,
1607+ config : testNodeConfig {
1608+ pollSuccessThreshold : 2 ,
1609+ pollInterval : - 1 ,
1610+ },
1611+ })
1612+ result := node .probeUntilStable (t .Context (), logger .Test (t ))
1613+ assert .True (t , result )
1614+ })
15861615 t .Run ("returns true immediately when threshold is zero, skipping probe" , func (t * testing.T ) {
15871616 t .Parallel ()
15881617 rpc := newMockRPCClient [ID , Head ](t )
0 commit comments