Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 119 for NewTestContext (0.33 sec)

  1. pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable_test.go

    				Spec: v1.NodeSpec{
    					Unschedulable: true,
    				},
    			},
    		},
    	}
    
    	for _, test := range testCases {
    		nodeInfo := framework.NewNodeInfo()
    		nodeInfo.SetNode(test.node)
    		_, ctx := ktesting.NewTestContext(t)
    		p, err := New(ctx, nil, nil)
    		if err != nil {
    			t.Fatalf("creating plugin: %v", err)
    		}
    		gotStatus := p.(framework.FilterPlugin).Filter(ctx, nil, test.pod, nodeInfo)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Dec 16 12:50:11 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  2. pkg/proxy/config/api_test.go

    	ktesting "k8s.io/client-go/testing"
    	klogtesting "k8s.io/klog/v2/ktesting"
    	"k8s.io/utils/ptr"
    )
    
    func TestNewServicesSourceApi_UpdatesAndMultipleServices(t *testing.T) {
    	_, ctx := klogtesting.NewTestContext(t)
    	service1v1 := &v1.Service{
    		ObjectMeta: metav1.ObjectMeta{Namespace: "testnamespace", Name: "s1"},
    		Spec:       v1.ServiceSpec{Ports: []v1.ServicePort{{Protocol: "TCP", Port: 10}}}}
    	service1v2 := &v1.Service{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 22 05:08:41 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  3. pkg/scheduler/internal/queue/scheduling_queue_test.go

    					logger, _ := ktesting.NewTestContext(t)
    					err := q.AddUnschedulableIfNotPresent(logger, poppedPod, q.SchedulingCycle())
    					if err != nil {
    						t.Fatalf("unexpected error from AddUnschedulableIfNotPresent: %v", err)
    					}
    				}},
    				{callback: func(t *testing.T, q *PriorityQueue) {
    					logger, _ := ktesting.NewTestContext(t)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 12 13:26:09 UTC 2024
    - 146.9K bytes
    - Viewed (0)
  4. pkg/proxy/config/config_test.go

    			t.Errorf("Timed out. Expected %#v, Got %#v", expectedSlices, slices)
    			return
    		}
    	}
    }
    
    func TestNewServiceAddedAndNotified(t *testing.T) {
    	_, ctx := klogtesting.NewTestContext(t)
    	client := fake.NewSimpleClientset()
    	fakeWatch := watch.NewFake()
    	client.PrependWatchReactor("services", ktesting.DefaultWatchReactor(fakeWatch, nil))
    
    	stopCh := make(chan struct{})
    	defer close(stopCh)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 22 05:08:41 UTC 2024
    - 14.3K bytes
    - Viewed (0)
  5. pkg/scheduler/framework/plugins/nodeports/node_ports_test.go

    			wantFilterStatus: framework.NewStatus(framework.Unschedulable, ErrReason),
    		},
    	}
    
    	for _, test := range tests {
    		t.Run(test.name, func(t *testing.T) {
    			_, ctx := ktesting.NewTestContext(t)
    			p, err := New(ctx, nil, nil)
    			if err != nil {
    				t.Fatalf("creating plugin: %v", err)
    			}
    			cycleState := framework.NewCycleState()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 19 11:02:11 UTC 2023
    - 10.1K bytes
    - Viewed (0)
  6. pkg/controller/tainteviction/timed_workers_test.go

    	queue.AddWork(context.TODO(), NewWorkArgs("3", "3"), now, then)
    	queue.AddWork(context.TODO(), NewWorkArgs("4", "4"), now, then)
    	queue.AddWork(context.TODO(), NewWorkArgs("5", "5"), now, then)
    	logger, _ := ktesting.NewTestContext(t)
    	queue.CancelWork(logger, NewWorkArgs("2", "2").KeyFromWorkArgs())
    	queue.CancelWork(logger, NewWorkArgs("4", "4").KeyFromWorkArgs())
    	fakeClock.Step(11 * time.Second)
    	wg.Wait()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 30 12:23:56 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  7. pkg/controller/volume/attachdetach/populator/desired_state_of_world_populator_test.go

    		intreeToCSITranslator:    csiTranslator,
    	}
    
    	//add the given node to the list of nodes managed by dsw
    	dswp.desiredStateOfWorld.AddNode(k8stypes.NodeName(pod.Spec.NodeName))
    	logger, _ := ktesting.NewTestContext(t)
    	dswp.findAndAddActivePods(logger)
    
    	expectedVolumeName := v1.UniqueVolumeName(generatedVolumeName)
    
    	//check if the given volume referenced by the pod is added to dsw
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 10:42:15 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  8. pkg/controller/endpointslice/endpointslice_controller_test.go

    		endpointSlice.Generation++
    		esIndexer.Update(endpointSlice)
    
    		return false, endpointSlice, nil
    	}))
    
    	_, ctx := ktesting.NewTestContext(t)
    	esController := NewController(
    		ctx,
    		informerFactory.Core().V1().Pods(),
    		informerFactory.Core().V1().Services(),
    		nodeInformer,
    		esInformer,
    		int32(100),
    		client,
    		batchPeriod)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 08:33:32 UTC 2024
    - 65.5K bytes
    - Viewed (0)
  9. pkg/controller/volume/attachdetach/metrics/metrics_test.go

    		fakePodInformer.Lister(),
    		pvLister,
    		nil,
    		nil,
    		fakeVolumePluginMgr,
    		csimigration.NewPluginManager(csiTranslator, utilfeature.DefaultFeatureGate),
    		csiTranslator)
    	logger, _ := ktesting.NewTestContext(t)
    	nodeUseMap := metricCollector.getVolumeInUseCount(logger)
    	if len(nodeUseMap) < 1 {
    		t.Errorf("Expected one volume in use got %d", len(nodeUseMap))
    	}
    	testNodeMetric := nodeUseMap["metric-test-host"]
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 10:42:15 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  10. pkg/controller/endpointslicemirroring/endpointslicemirroring_controller_test.go

    		expectedNumActions: 2, // extra action for creating warning event
    		expectedNumSlices:  1,
    	}}
    
    	for _, tc := range testCases {
    		t.Run(tc.testName, func(t *testing.T) {
    			_, ctx := ktesting.NewTestContext(t)
    			client, esController := newController(ctx, time.Duration(0))
    			tc.endpoints.Name = endpointsName
    			tc.endpoints.Namespace = namespace
    			esController.endpointsStore.Add(tc.endpoints)
    			if tc.service != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jul 12 12:57:29 UTC 2023
    - 13.9K bytes
    - Viewed (0)
Back to top