Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for NilChance (0.28 sec)

  1. pkg/kubelet/server/stats/summary_test.go

    }
    
    func getFsStats() *statsapi.FsStats {
    	f := fuzz.New().NilChance(0)
    	v := &statsapi.FsStats{}
    	f.Fuzz(v)
    	return v
    }
    
    func getContainerStats() *statsapi.ContainerStats {
    	f := fuzz.New().NilChance(0)
    	v := &statsapi.ContainerStats{}
    	f.Fuzz(v)
    	return v
    }
    func getVolumeCPUAndMemoryStats() *statsapi.ContainerStats {
    	f := fuzz.New().NilChance(0)
    	v := &statsapi.ContainerStats{}
    	f.Fuzz(&v.Name)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 08:12:16 UTC 2024
    - 15.1K bytes
    - Viewed (0)
  2. pkg/kubelet/server/stats/summary_windows_test.go

    	assert.Equal(summary.Pods, podStats)
    }
    
    func getFsStats() *statsapi.FsStats {
    	f := fuzz.New().NilChance(0)
    	v := &statsapi.FsStats{}
    	f.Fuzz(v)
    	return v
    }
    
    func getContainerStats() *statsapi.ContainerStats {
    	f := fuzz.New().NilChance(0)
    	v := &statsapi.ContainerStats{}
    	f.Fuzz(v)
    	return v
    }
    
    func getPodStats() *statsapi.PodStats {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 08:12:16 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapi/v2/conversion_test.go

    	invisible := 0 // == 0 means visible, > 0 means invisible
    	depth := 0
    	maxDepth := 3
    	nilChance := func(depth int) float64 {
    		return math.Pow(0.9, math.Max(0.0, float64(maxDepth-depth)))
    	}
    	updateFuzzer := func(depth int) {
    		f.NilChance(nilChance(depth))
    		f.NumElements(0, max(0, maxDepth-depth))
    	}
    	updateFuzzer(depth)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 02 14:34:26 UTC 2023
    - 23.2K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/api/meta/meta_test.go

    	metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"
    
    	"github.com/google/go-cmp/cmp"
    	fuzz "github.com/google/gofuzz"
    )
    
    func TestAsPartialObjectMetadata(t *testing.T) {
    	f := fuzz.New().NilChance(.5).NumElements(0, 1).RandSource(rand.NewSource(1))
    
    	for i := 0; i < 100; i++ {
    		m := &metav1.ObjectMeta{}
    		f.Fuzz(m)
    		partial := AsPartialObjectMetadata(m)
    		if !reflect.DeepEqual(&partial.ObjectMeta, m) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:48:03 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/api/apitesting/fuzzer/fuzzer.go

    // FuzzerFor can randomly populate api objects that are destined for version.
    func FuzzerFor(funcs FuzzerFuncs, src rand.Source, codecs runtimeserializer.CodecFactory) *fuzz.Fuzzer {
    	f := fuzz.New().NilChance(.5).NumElements(0, 1)
    	if src != nil {
    		f.RandSource(src)
    	}
    	f.Funcs(funcs(codecs)...)
    	return f
    }
    
    // MergeFuzzerFuncs will merge the given funcLists, overriding early funcs with later ones if there first
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Aug 01 19:31:12 UTC 2018
    - 1.6K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/kubeopenapi_test.go

    			case 3:
    				s.Object = []interface{}{}
    			case 4:
    				s.Object = map[string]interface{}{}
    			case 5:
    				s.Object = nil
    			case 6:
    				s.Object = int64(42)
    			}
    		},
    	)
    	f.MaxDepth(3)
    	f.NilChance(0.5)
    
    	for i := 0; i < 10000; i++ {
    		orig := &Structural{}
    		f.Fuzz(orig)
    
    		// normalize Structural.ValueValidation to zero values if it was nil before
    		normalizer := Visitor{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:46:16 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/validation_test.go

    			if c.RandBool() {
    				*vv = &NestedValueValidation{}
    			}
    		},
    		func(vv *NestedValueValidation, c fuzz.Continue) {
    			if c.RandBool() {
    				*vv = NestedValueValidation{}
    			}
    		},
    	)
    	fuzzer.NilChance(0)
    
    	// check that type must be object
    	typeNames := []string{"object", "array", "number", "integer", "boolean", "string"}
    	for _, typeName := range typeNames {
    		s := Structural{
    			Generic: Generic{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 31 18:20:00 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/convert_test.go

    			if s.Schema != nil {
    				s.Allows = false
    			}
    		},
    		func(s **string, c fuzz.Continue) {
    			c.FuzzNoCustom(s)
    			if *s != nil && **s == "" {
    				*s = nil
    			}
    		},
    	)
    
    	f.MaxDepth(2)
    	f.NilChance(0.5)
    
    	for i := 0; i < 10000; i++ {
    		// fuzz a random field in JSONSchemaProps
    		origSchema := &apiextensions.JSONSchemaProps{}
    		x := reflect.ValueOf(origSchema).Elem()
    		n := rand.Intn(x.NumField())
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 23 02:09:41 UTC 2022
    - 2.9K bytes
    - Viewed (0)
  9. pkg/registry/rbac/helpers_test.go

    		if tc.expected != actual {
    			t.Errorf("%s: expected %v, got %v", tc.name, tc.expected, actual)
    		}
    	}
    }
    
    func TestNewMetadataFields(t *testing.T) {
    	f := fuzz.New().NilChance(0.0).NumElements(1, 1)
    	for i := 0; i < 100; i++ {
    		objMeta := metav1.ObjectMeta{}
    		f.Fuzz(&objMeta)
    		objMeta.Name = ""
    		objMeta.GenerateName = ""
    		objMeta.Namespace = ""
    		objMeta.SelfLink = ""
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 05 20:12:50 UTC 2022
    - 4.7K bytes
    - Viewed (0)
  10. pkg/api/testing/defaulting_test.go

    		{Group: "flowcontrol.apiserver.k8s.io", Version: "v1", Kind: "PriorityLevelConfigurationList"}:             {},
    	}
    
    	f := fuzz.New().NilChance(.5).NumElements(1, 1).RandSource(rand.NewSource(1))
    	f.Funcs(
    		func(s *runtime.RawExtension, c fuzz.Continue) {},
    		func(s *metav1.LabelSelector, c fuzz.Continue) {
    			c.FuzzNoCustom(s)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 00:00:21 UTC 2024
    - 20.3K bytes
    - Viewed (0)
Back to top