Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 31 for NewFakeClock (0.15 sec)

  1. pkg/controller/serviceaccount/legacy_serviceaccount_token_cleaner_test.go

    				SyncInterval:  30 * time.Second,
    				CleanUpPeriod: tc.LegacyTokenCleanUpPeriod,
    			}
    			cleaner, _ := NewLegacySATokenCleaner(saInformer, secretInformer, podInformer, client, testingclock.NewFakeClock(time.Now().UTC()), options)
    
    			if tc.ExistingServiceAccount != nil {
    				serviceAccounts.Add(tc.ExistingServiceAccount)
    			}
    			if tc.ExistingPod != nil {
    				pods.Add(tc.ExistingPod)
    			}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 27 03:52:06 UTC 2023
    - 21.1K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission_test.go

    		getCalls++
    		return true, &v1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: namespace}, Status: v1.NamespaceStatus{Phase: phases[namespace]}}, nil
    	})
    
    	fakeClock := testingclock.NewFakeClock(time.Now())
    
    	handler, informerFactory, err := newHandlerForTestWithClock(mockClient, fakeClock)
    	if err != nil {
    		t.Errorf("unexpected error initializing handler: %v", err)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 00:00:21 UTC 2024
    - 14.2K bytes
    - Viewed (0)
  3. pkg/scheduler/scheduler_test.go

    			// Need to add/update/delete testPod to the store.
    			podInformer.Informer().GetStore().Add(testPod)
    
    			queue := internalqueue.NewPriorityQueue(nil, informerFactory, internalqueue.WithClock(testingclock.NewFakeClock(time.Now())))
    			schedulerCache := internalcache.New(ctx, 30*time.Second)
    
    			if err := queue.Add(logger, testPod); err != nil {
    				t.Fatalf("Add failed: %v", err)
    			}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 17 09:07:27 UTC 2024
    - 42K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/endpoints/filters/request_deadline_test.go

    	// then we will see a request deadline of about a minute.
    	receivedTimestampExpected := time.Now().Add(time.Minute)
    	fakeClock := testingclock.NewFakeClock(receivedTimestampExpected)
    
    	fakeSink := &fakeAuditSink{}
    	fakeRuleEvaluator := policy.NewFakePolicyRuleEvaluator(auditinternal.LevelRequestResponse, nil)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 14 23:04:34 UTC 2022
    - 16.7K bytes
    - Viewed (0)
  5. pkg/controller/testutil/test_utils.go

    func NewFakeRecorder() *FakeRecorder {
    	return &FakeRecorder{
    		source: v1.EventSource{Component: "nodeControllerTest"},
    		Events: []*v1.Event{},
    		clock:  testingclock.NewFakeClock(time.Now()),
    	}
    }
    
    // NewNode is a helper function for creating Nodes for testing.
    func NewNode(name string) *v1.Node {
    	return &v1.Node{
    		ObjectMeta: metav1.ObjectMeta{Name: name},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 28 08:48:22 UTC 2024
    - 15.6K bytes
    - Viewed (0)
  6. pkg/kubelet/images/image_manager_test.go

    		Name:            "container_name",
    		Image:           c.containerImage,
    		ImagePullPolicy: c.policy,
    	}
    
    	backOff := flowcontrol.NewBackOff(time.Second, time.Minute)
    	fakeClock = testingclock.NewFakeClock(time.Now())
    	backOff.Clock = fakeClock
    
    	fakeRuntime = &ctest.FakeRuntime{T: t}
    	fakeRecorder := &record.FakeRecorder{}
    
    	fakeRuntime.ImageList = []Image{{ID: "present_image:latest"}}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 19K bytes
    - Viewed (0)
  7. pkg/credentialprovider/plugin/plugin_test.go

    						t.Error("unexpected docker config")
    					}
    					w.Done()
    				}(&wg)
    			}
    			wg.Wait()
    
    		})
    	}
    }
    
    func Test_getCachedCredentials(t *testing.T) {
    	fakeClock := testingclock.NewFakeClock(time.Now())
    	p := &pluginProvider{
    		clock:          fakeClock,
    		lastCachePurge: fakeClock.Now(),
    		cache:          cache.NewExpirationStore(cacheKeyFunc, &cacheExpirationPolicy{clock: fakeClock}),
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 09 06:11:06 UTC 2022
    - 26.5K bytes
    - Viewed (0)
  8. pkg/kubelet/pleg/generic_test.go

    	return newTestGenericPLEGWithChannelSize(largeChannelCap)
    }
    
    func newTestGenericPLEGWithChannelSize(eventChannelCap int) *TestGenericPLEG {
    	fakeRuntime := &containertest.FakeRuntime{}
    	clock := testingclock.NewFakeClock(time.Time{})
    	// The channel capacity should be large enough to hold all events in a
    	// single test.
    	pleg := &GenericPLEG{
    		relistDuration: &RelistDuration{RelistPeriod: time.Hour, RelistThreshold: 3 * time.Minute},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 08:12:16 UTC 2024
    - 24.8K bytes
    - Viewed (0)
  9. pkg/controller/podgc/gc_controller_test.go

    				nodeInformer.Informer().GetStore().Add(node)
    			}
    			for _, pod := range test.pods {
    				podInformer.Informer().GetStore().Add(pod)
    			}
    			// Overwrite queue
    			fakeClock := testingclock.NewFakeClock(time.Now())
    			gcc.nodeQueue.ShutDown()
    			gcc.nodeQueue = workqueue.NewTypedDelayingQueueWithConfig(workqueue.TypedDelayingQueueConfig[string]{Clock: fakeClock, Name: "podgc_test_queue"})
    
    			// First GC of orphaned pods
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 12 08:16:48 UTC 2024
    - 29K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_cache_test.go

    	pr := newConditionalProgressRequester(wc.RequestWatchProgress, &immediateTickerFactory{}, nil)
    	go pr.Run(wc.stopCh)
    	wc.watchCache = newWatchCache(keyFunc, mockHandler, getAttrsFunc, versioner, indexers, testingclock.NewFakeClock(time.Now()), schema.GroupResource{Resource: "pods"}, pr)
    	// To preserve behavior of tests that assume a given capacity,
    	// resize it to th expected size.
    	wc.capacity = capacity
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 09:20:10 UTC 2024
    - 35.4K bytes
    - Viewed (0)
Back to top