Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 237 for withCancel (2.48 sec)

  1. cni/pkg/nodeagent/cni-watcher_test.go

    		Netns:        "/var/netns/foo",
    		PodName:      "pod-bingo",
    		PodNamespace: "funkyns",
    		IPs: []IPConfig{{
    			Address: *addr,
    		}},
    	}
    
    	setupLogging()
    	NodeName = "testnode"
    	ctx, cancel := context.WithCancel(context.Background())
    	defer cancel()
    	pod := &corev1.Pod{
    		ObjectMeta: metav1.ObjectMeta{
    			Name:      "pod-bingo",
    			Namespace: "funkyns",
    		},
    		Spec: corev1.PodSpec{
    			NodeName: NodeName,
    		},
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 06 21:31:35 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  2. pkg/controller/tainteviction/taint_eviction_test.go

    		t.Run(item.description, func(t *testing.T) {
    			featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.PodDisruptionConditions, item.enablePodDisruptionConditions)
    			ctx, cancel := context.WithCancel(context.Background())
    			fakeClientset := fake.NewSimpleClientset(&corev1.PodList{Items: []corev1.Pod{*item.pod}})
    			controller, podIndexer, _ := setupNewController(ctx, fakeClientset)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 25 14:24:16 UTC 2024
    - 31.3K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery_controller_test.go

    			discovery: make(map[string]*discovery.APIGroupHandler),
    		},
    	}
    
    	return env
    }
    
    func TestResourceManagerExistingCRD(t *testing.T) {
    	ctx, cancel := context.WithCancel(context.Background())
    	defer cancel()
    
    	env := setup()
    	_, err := env.Interface.
    		ApiextensionsV1().
    		CustomResourceDefinitions().
    		Create(
    			ctx,
    			coolFooCRD,
    			metav1.CreateOptions{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 18:15:22 UTC 2024
    - 12K bytes
    - Viewed (0)
  4. pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions_test.go

    			preFilterWantStatus: framework.NewStatus(framework.Skip),
    			wantStatus:          nil,
    		},
    	}
    
    	for _, test := range tests {
    		t.Run(test.name, func(t *testing.T) {
    			ctx, cancel := context.WithCancel(context.Background())
    			defer cancel()
    			p := newPlugin(ctx, t)
    			cycleState := framework.NewCycleState()
    			_, preFilterGotStatus := p.(framework.PreFilterPlugin).PreFilter(ctx, cycleState, test.pod)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 20 17:40:39 UTC 2023
    - 17.3K bytes
    - Viewed (0)
  5. src/cmd/vet/testdata/lostcancel/lostcancel.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package lostcancel
    
    import "context"
    
    func _() {
    	var _, cancel = context.WithCancel(context.Background()) // ERROR "the cancel function is not used on all paths \(possible context leak\)"
    	if false {
    		_ = cancel
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 20 15:46:42 UTC 2019
    - 475 bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/util/wait/wait_test.go

    		close(called)
    	}()
    	<-called
    	close(ch)
    	<-called
    }
    
    func TestUntilWithContext(t *testing.T) {
    	ctx, cancel := context.WithCancel(context.TODO())
    	cancel()
    	UntilWithContext(ctx, func(context.Context) {
    		t.Fatal("should not have been invoked")
    	}, 0)
    
    	ctx, cancel = context.WithCancel(context.TODO())
    	called := make(chan struct{})
    	go func() {
    		UntilWithContext(ctx, func(context.Context) {
    			called <- struct{}{}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 26 16:28:45 UTC 2024
    - 41.1K bytes
    - Viewed (0)
  7. cmd/benchmark-utils_test.go

    func benchmarkPutObjectPart(b *testing.B, instanceType string, objSize int) {
    	// create a temp Erasure/FS backend.
    	ctx, cancel := context.WithCancel(context.Background())
    	defer cancel()
    	objLayer, disks, err := prepareTestBackend(ctx, instanceType)
    	if err != nil {
    		b.Fatalf("Failed obtaining Temp Backend: <ERROR> %s", err)
    	}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Dec 23 15:46:00 UTC 2022
    - 8.2K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/testing/promise/counting_test.go

    }
    func TestCountingWriteOnceCancel(t *testing.T) {
    	oldTime := time.Now()
    	cval := &oldTime
    	clock, counter := testeventclock.NewFake(oldTime, 0, nil)
    	ctx, cancel := context.WithCancel(context.Background())
    	var lock sync.Mutex
    	wr := NewCountingWriteOnce(counter, &lock, nil, ctx.Done(), cval)
    	gots := make(chan interface{}, 1)
    	goGetExpectNotYet(t, clock, counter, wr, gots, "cancel")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 10 14:37:53 UTC 2021
    - 4.6K bytes
    - Viewed (0)
  9. pkg/scheduler/internal/cache/cache_test.go

    			make(map[string]*framework.ImageStateSummary),
    		),
    	},
    	}
    
    	for _, tc := range tests {
    		t.Run(tc.name, func(t *testing.T) {
    			logger, ctx := ktesting.NewTestContext(t)
    			ctx, cancel := context.WithCancel(ctx)
    			defer cancel()
    			cache := newCache(ctx, time.Second, time.Second)
    			for _, pod := range tc.pods {
    				if err := cache.AssumePod(logger, pod); err != nil {
    					t.Fatalf("AssumePod failed: %v", err)
    				}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 17 01:38:03 UTC 2023
    - 63.8K bytes
    - Viewed (0)
  10. cni/cmd/install-cni/main.go

    import (
    	"context"
    	"os"
    	"os/signal"
    	"syscall"
    
    	"istio.io/istio/cni/pkg/cmd"
    	"istio.io/istio/pkg/log"
    )
    
    func main() {
    	// Create context that cancels on termination signal
    	ctx, cancel := context.WithCancel(context.Background())
    	sigChan := make(chan os.Signal, 1)
    	signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM)
    	go func(sigChan chan os.Signal, cancel context.CancelFunc) {
    		sig := <-sigChan
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 1.2K bytes
    - Viewed (0)
Back to top