Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 113 for withCancel (0.18 sec)

  1. src/context/x_test.go

    		t.Errorf("TODO().String() = %q want %q", got, want)
    	}
    }
    
    func TestWithCancel(t *testing.T) {
    	c1, cancel := WithCancel(Background())
    
    	if got, want := fmt.Sprint(c1), "context.Background.WithCancel"; got != want {
    		t.Errorf("c1.String() = %q want %q", got, want)
    	}
    
    	o := otherContext{c1}
    	c2, _ := WithCancel(o)
    	contexts := []Context{c1, o, c2}
    
    	for i, c := range contexts {
    		if d := c.Done(); d == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  2. cni/pkg/nodeagent/informers_test.go

    	"istio.io/istio/pkg/monitoring/monitortest"
    	"istio.io/istio/pkg/test/util/assert"
    )
    
    func TestExistingPodAddedWhenNsLabeled(t *testing.T) {
    	setupLogging()
    	NodeName = "testnode"
    	ctx, cancel := context.WithCancel(context.Background())
    	defer cancel()
    
    	pod := &corev1.Pod{
    		ObjectMeta: metav1.ObjectMeta{
    			Name:      "test",
    			Namespace: "test",
    		},
    		Spec: corev1.PodSpec{
    			NodeName: NodeName,
    		},
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 06 05:10:23 UTC 2024
    - 22.2K bytes
    - Viewed (0)
  3. cni/pkg/nodeagent/net_test.go

    			UID:       "123",
    		},
    		Spec: corev1.PodSpec{
    			Containers: containers,
    		},
    		Status: podStatus,
    	}
    }
    
    func TestServerAddPod(t *testing.T) {
    	ctx, cancel := context.WithCancel(context.Background())
    	defer cancel()
    	setupLogging()
    	fixture := getTestFixure(ctx)
    	netServer := fixture.netServer
    	ztunnelServer := fixture.ztunnelServer
    	podMeta := metav1.ObjectMeta{
    		Name:      "foo",
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 06 05:10:23 UTC 2024
    - 17.8K bytes
    - Viewed (0)
  4. src/context/context.go

    // calls between them must propagate the Context, optionally replacing
    // it with a derived Context created using [WithCancel], [WithDeadline],
    // [WithTimeout], or [WithValue]. When a Context is canceled, all
    // Contexts derived from it are also canceled.
    //
    // The [WithCancel], [WithDeadline], and [WithTimeout] functions take a
    // Context (the parent) and return a derived Context (the child) and a
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 23.7K bytes
    - Viewed (0)
  5. cmd/erasure-object_test.go

    	"runtime"
    	"strconv"
    	"testing"
    
    	"github.com/dustin/go-humanize"
    	"github.com/minio/minio/internal/config/storageclass"
    )
    
    func TestRepeatPutObjectPart(t *testing.T) {
    	ctx, cancel := context.WithCancel(context.Background())
    	defer cancel()
    
    	var objLayer ObjectLayer
    	var disks []string
    	var err error
    	var opts ObjectOptions
    
    	objLayer, disks, err = prepareErasure16(ctx)
    	if err != nil {
    		t.Fatal(err)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Jan 30 20:43:25 UTC 2024
    - 36.8K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. staging/src/k8s.io/apiserver/pkg/server/filters/maxinflight_test.go

    	waitForCallsMutex := sync.Mutex{}
    
    	server := createMaxInflightServer(t, calls, block, &waitForCalls, &waitForCallsMutex, AllowedNonMutatingInflightRequestsNo, 1)
    	defer server.Close()
    
    	ctx, cancel := context.WithCancel(context.Background())
    	defer cancel()
    	StartMaxInFlightWatermarkMaintenance(ctx.Done())
    
    	// These should hang, but not affect accounting.  use a query param match
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 26 17:14:05 UTC 2022
    - 10.2K bytes
    - Viewed (0)
Back to top