Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 192 for newTimer (0.1 sec)

  1. src/os/timeout_test.go

    func TestReadTimeoutMustNotReturn(t *testing.T) {
    	t.Parallel()
    
    	r, w, err := os.Pipe()
    	if err != nil {
    		t.Fatal(err)
    	}
    	defer r.Close()
    	defer w.Close()
    
    	max := time.NewTimer(100 * time.Millisecond)
    	defer max.Stop()
    	ch := make(chan error)
    	go func() {
    		if err := r.SetDeadline(time.Now().Add(-5 * time.Second)); err != nil {
    			t.Error(err)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 14 00:03:57 UTC 2023
    - 17.1K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/server/filters/goaway_test.go

    				t.Fatalf("expect TCP connection: %d, actual: %d", tc.expectConnections, len(localAddr))
    			}
    
    			// check if watch request is broken by GOAWAY frame
    			watchTimeout := time.NewTimer(time.Second * 10)
    			defer watchTimeout.Stop()
    			for _, watchCh := range watchChs {
    				select {
    				case watchResp := <-watchCh:
    					if watchResp.err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 17 12:58:54 UTC 2021
    - 13.9K bytes
    - Viewed (0)
  3. tools/istio-iptables/pkg/validation/validator.go

    	log.Infof("Starting iptables validation. This check verifies that iptables rules are properly established for the network.")
    	s := Service{
    		validator.Config,
    	}
    	sError := make(chan error, 1)
    	sTimer := time.NewTimer(s.Config.ProbeTimeout)
    	defer sTimer.Stop()
    	go func() {
    		sError <- s.Run()
    	}()
    
    	// infinite loop
    	go func() {
    		c := Client{Config: validator.Config}
    		<-c.Config.ServerReadyBarrier
    		for {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Nov 01 04:37:36 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  4. cmd/callhome.go

    		return true
    	}
    
    	ctx = lkctx.Context()
    	defer locker.Unlock(lkctx)
    
    	// Perform callhome once and then keep running it at regular intervals.
    	performCallhome(ctx)
    
    	callhomeTimer := time.NewTimer(globalCallhomeConfig.FrequencyDur())
    	defer callhomeTimer.Stop()
    
    	for {
    		if !globalCallhomeConfig.Enabled() {
    			// Stop the processing as callhome got disabled
    			return false
    		}
    
    		select {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 17 16:53:34 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  5. cmd/lock-rest-server.go

    // that have not been refreshed for some time.
    func lockMaintenance(ctx context.Context) {
    	if !globalIsDistErasure {
    		return
    	}
    
    	// Initialize a new ticker with 1 minute between each ticks.
    	lkTimer := time.NewTimer(lockMaintenanceInterval)
    	// Stop the timer upon returning.
    	defer lkTimer.Stop()
    
    	for {
    		// Verifies every minute for locks held more than 2 minutes.
    		select {
    		case <-ctx.Done():
    			return
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Nov 21 01:09:35 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/util/wait/loop_test.go

    	testingclock "k8s.io/utils/clock/testing"
    )
    
    func timerWithClock(t Timer, c clock.WithTicker) Timer {
    	switch t := t.(type) {
    	case *fixedTimer:
    		t.new = c.NewTicker
    	case *variableTimer:
    		t.new = c.NewTimer
    	default:
    		panic("unrecognized timer type, cannot inject clock")
    	}
    	return t
    }
    
    func Test_loopConditionWithContextImmediateDelay(t *testing.T) {
    	fakeClock := testingclock.NewFakeClock(time.Time{})
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 19 02:48:08 UTC 2023
    - 15.8K bytes
    - Viewed (0)
  7. pkg/queue/delay.go

    			if delay <= 0 {
    				// execute now and continue processing incoming enqueues/tasks
    				if !push(task) {
    					return
    				}
    			} else {
    				// not ready yet, don't block enqueueing
    				await := time.NewTimer(delay)
    				select {
    				case t := <-d.enqueue:
    					d.mu.Lock()
    					heap.Push(d.queue, t)
    					// put the old "head" back on the queue, it may be scheduled to execute after the one
    					// that was just pushed
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jul 20 06:27:31 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  8. pkg/kube/controllers/queue.go

    // WaitForClose an error if the timeout expires.
    func (q Queue) WaitForClose(timeout time.Duration) error {
    	closed := q.Closed()
    	if timeout == 0 {
    		<-closed
    		return nil
    	}
    	timer := time.NewTimer(timeout)
    	defer timer.Stop()
    	select {
    	case <-closed:
    		return nil
    	case <-timer.C:
    		return fmt.Errorf("timeout waiting for queue to close after %v", timeout)
    	}
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Aug 08 16:43:05 UTC 2023
    - 6.3K bytes
    - Viewed (0)
  9. src/context/x_test.go

    			t.Errorf("c[%d].Err() == %v want %v", i, e, Canceled)
    		}
    	}
    }
    
    func testDeadline(c Context, name string, t *testing.T) {
    	t.Helper()
    	d := quiescent(t)
    	timer := time.NewTimer(d)
    	defer timer.Stop()
    	select {
    	case <-timer.C:
    		t.Fatalf("%s: context not timed out after %v", name, d)
    	case <-c.Done():
    	}
    	if e := c.Err(); e != DeadlineExceeded {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  10. cmd/bucket-targets.go

    	}
    	clnt.SetCustomTransport(globalRemoteTargetTransport)
    	return clnt
    }
    
    // heartBeat performs liveness check on remote endpoints.
    func (sys *BucketTargetSys) heartBeat(ctx context.Context) {
    	hcTimer := time.NewTimer(defaultHealthCheckDuration)
    	defer hcTimer.Stop()
    	for {
    		select {
    		case <-hcTimer.C:
    			sys.hMutex.RLock()
    			eps := make([]madmin.ServerProperties, 0, len(sys.hc))
    			for _, ep := range sys.hc {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 01 01:09:56 UTC 2024
    - 20.9K bytes
    - Viewed (0)
Back to top