Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 43 for newResource (0.21 sec)

  1. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/convert_test.go

    )
    
    func TestStructuralRoundtripOrError(t *testing.T) {
    	f := fuzz.New()
    	seed := time.Now().UnixNano()
    	t.Logf("seed = %v", seed)
    	//seed = int64(1549012506261785182)
    	f.RandSource(rand.New(rand.NewSource(seed)))
    	f.Funcs(
    		func(s *apiextensions.JSON, c fuzz.Continue) {
    			*s = apiextensions.JSON(map[string]interface{}{"foo": float64(42.2)})
    		},
    		func(s *apiextensions.JSONSchemaPropsOrArray, c fuzz.Continue) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 23 02:09:41 UTC 2022
    - 2.9K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/round_trip_test.go

    	authenticationv1beta1 "k8s.io/api/authentication/v1beta1"
    )
    
    func TestRoundTrip(t *testing.T) {
    	f := fuzz.New()
    	seed := time.Now().UnixNano()
    	t.Logf("seed = %v", seed)
    	f.RandSource(rand.New(rand.NewSource(seed)))
    
    	for i := 0; i < 1000; i++ {
    		original := &authenticationv1.TokenReview{}
    		f.Fuzz(&original.Spec)
    		f.Fuzz(&original.Status)
    		converted := &authenticationv1beta1.TokenReview{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:48:03 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/kubeopenapi_test.go

    )
    
    func TestStructuralKubeOpenAPIRoundtrip(t *testing.T) {
    	f := fuzz.New()
    	seed := time.Now().UnixNano()
    	t.Logf("seed = %v", seed)
    	//seed = int64(1549012506261785182)
    	f.RandSource(rand.New(rand.NewSource(seed)))
    	f.Funcs(
    		func(s *JSON, c fuzz.Continue) {
    			switch c.Intn(7) {
    			case 0:
    				s.Object = float64(42.2)
    			case 1:
    				s.Object = map[string]interface{}{"foo": "bar"}
    			case 2:
    				s.Object = ""
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:46:16 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/util/cache/expiring_test.go

    	for i := 0; i < numKeys; i++ {
    		key := uuid.New().String()
    		keys = append(keys, key)
    	}
    
    	b.ResetTimer()
    
    	b.SetParallelism(256)
    	b.RunParallel(func(pb *testing.PB) {
    		rand := rand.New(rand.NewSource(rand.Int63()))
    		for pb.Next() {
    			i := rand.Int31()
    			key := keys[i%numKeys]
    			_, ok := cache.Get(key)
    			if ok {
    				// compare lower bits of sampled i to decide whether we should evict.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 22 15:51:23 UTC 2023
    - 7.3K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/round_trip_test.go

    	authorizationv1beta1 "k8s.io/api/authorization/v1beta1"
    )
    
    func TestRoundTrip(t *testing.T) {
    	f := fuzz.New()
    	seed := time.Now().UnixNano()
    	t.Logf("seed = %v", seed)
    	f.RandSource(rand.New(rand.NewSource(seed)))
    
    	for i := 0; i < 1000; i++ {
    		original := &authorizationv1.SubjectAccessReview{}
    		f.Fuzz(&original.Spec)
    		f.Fuzz(&original.Status)
    		converted := &authorizationv1beta1.SubjectAccessReview{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:48:03 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  6. cmd/license-update.go

    )
    
    // initlicenseUpdateJob start the periodic license update job in the background.
    func initLicenseUpdateJob(ctx context.Context, objAPI ObjectLayer) {
    	go func() {
    		r := rand.New(rand.NewSource(time.Now().UnixNano()))
    		// Leader node (that successfully acquires the lock inside licenceUpdaterLoop)
    		// will keep performing the license update. If the leader goes down for some
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Apr 04 12:04:40 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  7. pkg/test/loadbalancersim/loadbalancer/leastrequest.go

    }
    
    // nolint: gosec
    // Test only code
    func newUnweightedLeastRequest(conn *weightedConnections) network.Connection {
    	return &unweightedLeastRequest{
    		weightedConnections: conn,
    		r:                   rand.New(rand.NewSource(time.Now().UnixNano())),
    	}
    }
    
    func (lb *unweightedLeastRequest) pick2() (*WeightedConnection, *WeightedConnection) {
    	numConnections := len(lb.conns)
    	index1 := lb.r.Intn(numConnections)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Nov 14 20:23:34 UTC 2022
    - 3.4K bytes
    - Viewed (0)
  8. src/runtime/lfstack_test.go

    	for i := 0; i < K; i++ {
    		sum += i
    		node := allocMyNode(i)
    		LFStackPush(stacks[i%2], fromMyNode(node))
    	}
    	c := make(chan bool, P)
    	for p := 0; p < P; p++ {
    		go func() {
    			r := rand.New(rand.NewSource(rand.Int63()))
    			// Pop a node from a random stack, then push it onto a random stack.
    			for i := 0; i < N; i++ {
    				node := toMyNode(LFStackPop(stacks[r.Intn(2)]))
    				if node != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 17 23:12:04 UTC 2022
    - 2.7K bytes
    - Viewed (0)
  9. src/math/rand/example_test.go

    func Example_rand() {
    	// Create and seed the generator.
    	// Typically a non-fixed seed should be used, such as time.Now().UnixNano().
    	// Using a fixed seed will produce the same output on every run.
    	r := rand.New(rand.NewSource(99))
    
    	// The tabwriter here helps us generate aligned output.
    	w := tabwriter.NewWriter(os.Stdout, 1, 1, 1, ' ', 0)
    	defer w.Flush()
    	show := func(name string, v1, v2, v3 any) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 26 16:24:57 UTC 2022
    - 4.2K bytes
    - Viewed (0)
  10. src/os/writeto_linux_test.go

    		t.Fatalf("failed to create temporary file: %v", err)
    	}
    	t.Cleanup(func() {
    		f.Close()
    	})
    
    	randSeed := time.Now().Unix()
    	t.Logf("random data seed: %d\n", randSeed)
    	prng := rand.New(rand.NewSource(randSeed))
    	data := make([]byte, size)
    	prng.Read(data)
    	if _, err := f.Write(data); err != nil {
    		t.Fatalf("failed to create and feed the file: %v", err)
    	}
    	if err := f.Sync(); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 18:12:56 UTC 2024
    - 4K bytes
    - Viewed (0)
Back to top