Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for resultChan (0.14 sec)

  1. staging/src/k8s.io/apimachinery/pkg/watch/watch.go

    	// must always be called, even if the consumer has not yet called
    	// ResultChan().
    	//
    	// Only the consumer should call Stop(), not the producer. If the producer
    	// errors and needs to stop the watch prematurely, it should instead send
    	// an error event and close the result channel.
    	Stop()
    
    	// ResultChan returns a channel which will receive events from the event
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 12 20:06:22 UTC 2024
    - 8.1K bytes
    - Viewed (1)
  2. staging/src/k8s.io/apiserver/pkg/storage/testing/utils.go

    	case e, ok := <-w.ResultChan():
    		if ok {
    			var obj string
    			switch e.Object.(type) {
    			case *example.Pod:
    				obj = e.Object.(*example.Pod).Name
    			case *v1.Status:
    				obj = e.Object.(*v1.Status).Message
    			}
    			t.Errorf("ResultChan should have been closed. Event: %s. Object: %s", e.Type, obj)
    		}
    	case <-time.After(wait.ForeverTestTimeout):
    		t.Errorf("time out after waiting 1s on ResultChan")
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 22 07:26:55 UTC 2024
    - 10.3K bytes
    - Viewed (1)
  3. staging/src/k8s.io/apiserver/pkg/storage/etcd3/watcher_test.go

    	w := store.watcher.createWatchChan(ctx, "/abc", 0, false, false, storage.Everything)
    	// make resultChan and errChan blocking to ensure ordering.
    	w.resultChan = make(chan watch.Event)
    	w.errChan = make(chan error)
    	// The event flow goes like:
    	// - first we send an error, it should block on resultChan.
    	// - Then we cancel ctx. The blocking on resultChan should be freed up
    	//   and run() goroutine should return.
    	var wg sync.WaitGroup
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 12.3K bytes
    - Viewed (1)
  4. cni/pkg/install/cniconfig_test.go

    			defer cancel()
    			resultChan, errChan := make(chan string, 1), make(chan error, 1)
    			go func(resultChan chan string, errChan chan error, ctx context.Context, cniConfName, mountedCNINetDir string, chained bool) {
    				result, err := getCNIConfigFilepath(ctx, cniConfName, mountedCNINetDir, chained)
    				if err != nil {
    					errChan <- err
    					return
    				}
    				resultChan <- result
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 21 18:32:01 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/storage/cacher/cache_watcher_test.go

    	}()
    
    	// We expect all init events to be delivered.
    	for i := 0; i < numObjects; i++ {
    		<-w.ResultChan()
    	}
    	// We don't expect any other event to be delivered and thus
    	// the ResultChan to be closed.
    	result, ok := <-w.ResultChan()
    	if ok {
    		t.Errorf("unexpected event: %#v", result)
    	}
    
    	wg.Wait()
    }
    
    func TestTimeBucketWatchersBasic(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 09:20:10 UTC 2024
    - 22.9K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher_whitebox_test.go

    	d.RLock()
    	defer d.RUnlock()
    	return d.requestWatchProgressCounter
    }
    
    type dummyWatch struct {
    	ch chan watch.Event
    }
    
    func (w *dummyWatch) ResultChan() <-chan watch.Event {
    	return w.ch
    }
    
    func (w *dummyWatch) Stop() {
    	close(w.ch)
    }
    
    func newDummyWatch() watch.Interface {
    	return &dummyWatch{
    		ch: make(chan watch.Event),
    	}
    }
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 12 10:12:02 UTC 2024
    - 82.9K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiextensions-apiserver/test/integration/basic_test.go

    			t.Errorf("expected %v, got %v", e, a)
    		}
    		for watchVersion, noxuWatch := range noxuWatchs {
    			select {
    			case watchEvent := <-noxuWatch.ResultChan():
    				if e, a := watch.Added, watchEvent.Type; e != a {
    					t.Errorf("expected %v, got %v", e, a)
    					break
    				}
    				createdObjectMeta, err := meta.Accessor(watchEvent.Object)
    				if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 23 11:35:33 UTC 2024
    - 33.4K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiextensions-apiserver/test/integration/change_test.go

    			w, err := noxuNamespacedResourceClient.Watch(context.TODO(), metav1.ListOptions{})
    			if err != nil {
    				t.Errorf("unexpected error establishing watch: %v", err)
    				return
    			}
    			for event := range w.ResultChan() {
    				switch event.Type {
    				case watch.Added, watch.Modified, watch.Deleted:
    					// all expected
    				default:
    					t.Errorf("unexpected watch event: %#v", event)
    				}
    			}
    		}(i)
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jun 06 13:59:03 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  9. security/pkg/k8s/chiron/utils.go

    	})
    	if err != nil {
    		return nil, fmt.Errorf("failed to watch CSR %v", csr)
    	}
    
    	// Set a timeout
    	timer := time.After(watchTimeout)
    	for {
    		select {
    		case r := <-watcher.ResultChan():
    			reqSigned := r.Object.(*cert.CertificateSigningRequest)
    			if reqSigned.Status.Certificate != nil {
    				return reqSigned.Status.Certificate, nil
    			}
    		case <-timer:
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Apr 05 18:11:22 UTC 2024
    - 9.2K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/storage/testing/watcher_tests.go

    		ResourceVersion: "0",
    		Predicate:       storage.Everything,
    	})
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	select {
    	case _, ok := <-w.ResultChan():
    		if ok {
    			t.Error("ResultChan() should be closed")
    		}
    	case <-time.After(wait.ForeverTestTimeout):
    		t.Errorf("timeout after %v", wait.ForeverTestTimeout)
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 63.8K bytes
    - Viewed (0)
Back to top