Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 22 for NewTestContext (0.15 sec)

  1. pkg/controller/podgc/gc_controller_test.go

    			},
    			threshold:       1,
    			deletedPodNames: sets.New("c"),
    		},
    	}
    	for _, test := range testCases {
    		t.Run(test.name, func(t *testing.T) {
    			resetMetrics()
    			_, ctx := ktesting.NewTestContext(t)
    			featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.PodDisruptionConditions, test.enablePodDisruptionConditions)
    			creationTime := time.Unix(0, 0)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 12 08:16:48 UTC 2024
    - 29K bytes
    - Viewed (0)
  2. pkg/kubelet/volumemanager/reconciler/reconstruct_test.go

    			rcInstance, _ := rc.(*reconciler)
    			rcInstance.volumesFailedReconstruction = tc.volumesFailedReconstruction
    			logger, _ := ktesting.NewTestContext(t)
    			for _, tpodInfo := range tc.podInfos {
    				pod := getInlineFakePod(tpodInfo.podName, tpodInfo.podUID, tpodInfo.outerVolumeName, tpodInfo.innerVolumeName)
    				volumeSpec := &volume.Spec{Volume: &pod.Spec.Volumes[0]}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 06:25:43 UTC 2024
    - 14.8K bytes
    - Viewed (0)
  3. pkg/controller/statefulset/stateful_set_utils_test.go

    	for _, tc := range testCases {
    		for _, useOtherRefs := range []bool{false, true} {
    			for _, setPodRef := range []bool{false, true} {
    				for _, setSetRef := range []bool{false, true} {
    					_, ctx := ktesting.NewTestContext(t)
    					logger := klog.FromContext(ctx)
    					claim := v1.PersistentVolumeClaim{}
    					claim.Name = "target-claim"
    					pod := v1.Pod{}
    					pod.Name = fmt.Sprintf("pod-%d", tc.ordinal)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 05 19:06:41 UTC 2024
    - 50.9K bytes
    - Viewed (0)
  4. pkg/scheduler/framework/runtime/framework_test.go

    		},
    	}
    
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			profile := config.KubeSchedulerProfile{Plugins: tt.plugins}
    			_, ctx := ktesting.NewTestContext(t)
    			ctx, cancel := context.WithCancel(ctx)
    			defer cancel()
    			_, err := newFrameworkWithQueueSortAndBind(ctx, registry, profile)
    			if tt.initErr && err == nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 17 09:07:27 UTC 2024
    - 103K bytes
    - Viewed (0)
  5. pkg/scheduler/framework/plugins/nodevolumelimits/csi_test.go

    				scLister:             getFakeCSIStorageClassLister(scName, test.driverNames[0]),
    				randomVolumeIDPrefix: rand.String(32),
    				translator:           csiTranslator,
    			}
    			_, ctx := ktesting.NewTestContext(t)
    			_, gotPreFilterStatus := p.PreFilter(ctx, nil, test.newPod)
    			if diff := cmp.Diff(test.wantPreFilterStatus, gotPreFilterStatus); diff != "" {
    				t.Errorf("PreFilter status does not match (-want, +got): %s", diff)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 14 18:07:11 UTC 2024
    - 28.6K bytes
    - Viewed (0)
  6. pkg/scheduler/schedule_one_test.go

    				t.Errorf("got binding diff (-want, +got): %s", diff)
    			}
    			stopFunc()
    		})
    	}
    }
    
    func TestSchedulerNoPhantomPodAfterExpire(t *testing.T) {
    	logger, ctx := ktesting.NewTestContext(t)
    	ctx, cancel := context.WithCancel(ctx)
    	defer cancel()
    	queuedPodStore := clientcache.NewFIFO(clientcache.MetaNamespaceKeyFunc)
    	scache := internalcache.New(ctx, 100*time.Millisecond)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 06:20:55 UTC 2024
    - 128.1K bytes
    - Viewed (0)
  7. pkg/controller/job/backoff_utils_test.go

    			maxBackoff:     700 * time.Second,
    			wantDuration:   20 * time.Second,
    		},
    	}
    
    	for name, tc := range testCases {
    		t.Run(name, func(t *testing.T) {
    			logger, _ := ktesting.NewTestContext(t)
    			fakeClock := clocktesting.NewFakeClock(tc.currentTime.Truncate(time.Second))
    			d := getRemainingTimePerIndex(logger, fakeClock, tc.defaultBackoff, tc.maxBackoff, tc.lastFailedPod)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jun 06 07:46:41 UTC 2024
    - 16.7K bytes
    - Viewed (0)
  8. pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go

    			}
    			var extenders []framework.Extender
    			if tt.extender != nil {
    				extenders = append(extenders, tt.extender)
    			}
    			logger, ctx := ktesting.NewTestContext(t)
    			ctx, cancel := context.WithCancel(ctx)
    			defer cancel()
    			f, err := tf.NewFramework(ctx, registeredPlugins, "",
    				frameworkruntime.WithClientSet(cs),
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 31 15:52:16 UTC 2024
    - 82.8K bytes
    - Viewed (0)
  9. pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go

    			// claims not using structured parameters.
    			expectedHint: framework.Queue,
    		},
    	}
    
    	for name, tc := range testcases {
    		t.Run(name, func(t *testing.T) {
    			logger, _ := ktesting.NewTestContext(t)
    			testCtx := setup(t, nil, tc.claims, nil, nil, nil)
    			if claim, ok := tc.newObj.(*resourcev1alpha2.ResourceClaim); ok {
    				// Update the informer because the lister gets called and must have the claim.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 27 07:57:10 UTC 2024
    - 61.9K bytes
    - Viewed (0)
  10. src/testing/testing.go

    	running int
    
    	// numWaiting is the number tests waiting to be run in parallel.
    	numWaiting int
    
    	// maxParallel is a copy of the parallel flag.
    	maxParallel int
    }
    
    func newTestContext(maxParallel int, m *matcher) *testContext {
    	return &testContext{
    		match:         m,
    		startParallel: make(chan bool),
    		maxParallel:   maxParallel,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 76.1K bytes
    - Viewed (0)
Back to top