Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 156 for Dialer (0.31 sec)

  1. pkg/test/util.go

    func SetForTest[T any](t Failer, vv *T, v T) {
    	old := *vv
    	*vv = v
    	t.Cleanup(func() {
    		*vv = old
    	})
    }
    
    // SetEnvForTest sets an environment variable for the duration of a test, then resets it once the test is complete.
    func SetEnvForTest(t Failer, k, v string) {
    	old, oldset := os.LookupEnv(k)
    	if err := os.Setenv(k, v); err != nil {
    		t.Fatal(err)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jan 05 01:20:59 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  2. test/fixedbugs/issue32477.go

    import "runtime"
    
    var finalized bool
    var err string
    
    type HeapObj [8]int64
    
    const filler int64 = 0x123456789abcdef0
    
    func (h *HeapObj) init() {
    	for i := 0; i < len(*h); i++ {
    		h[i] = filler
    	}
    }
    func (h *HeapObj) check() {
    	for i := 0; i < len(*h); i++ {
    		if h[i] != filler {
    			err = "filler overwritten"
    		}
    	}
    }
    
    func gc(shouldFinalize bool) {
    	runtime.GC()
    	runtime.GC()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 18:51:04 UTC 2019
    - 1.2K bytes
    - Viewed (0)
  3. pilot/pkg/xds/adstest.go

    	"istio.io/istio/pkg/test"
    )
    
    func NewAdsTest(t test.Failer, conn *grpc.ClientConn) *AdsTest {
    	return NewXdsTest(t, conn, func(conn *grpc.ClientConn) (DiscoveryClient, error) {
    		xds := discovery.NewAggregatedDiscoveryServiceClient(conn)
    		return xds.StreamAggregatedResources(context.Background())
    	})
    }
    
    func NewSdsTest(t test.Failer, conn *grpc.ClientConn) *AdsTest {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sun Feb 04 03:39:42 UTC 2024
    - 6K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/util/shufflesharding/shufflesharding_test.go

    		},
    	}
    	for _, test := range tests {
    		hashValue := rand.Uint64()
    		t.Run(test.name, func(t *testing.T) {
    			dealer, err := NewDealer(test.deckSize, test.handSize)
    			if err != nil {
    				t.Errorf("fail to create Dealer: %v", err)
    				return
    			}
    			hand := make([]int, 0)
    			hand = dealer.DealIntoHand(hashValue, hand)
    
    			// check cards number
    			if len(hand) != int(test.handSize) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jan 25 06:44:08 UTC 2021
    - 6.7K bytes
    - Viewed (0)
  5. src/net/net_fake_test.go

    		if err != nil {
    			t.Fatalf("unexpected error from Dial with %v connections: %v", len(dialed), err)
    		}
    		dialed = append(dialed, c)
    		if testing.Verbose() && len(dialed)%(1<<12) == 0 {
    			t.Logf("dialed %d connections", len(dialed))
    		}
    	}
    	t.Logf("dialed %d connections", len(dialed))
    
    	// Now that all of the ports are in use, dialing another should fail due
    	// to port exhaustion, which (for POSIX-like socket APIs) should return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 17:20:52 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  6. pkg/test/framework/components/echo/sidecar.go

    	WaitForConfigOrFail(t test.Failer, accept func(*admin.ConfigDump) (bool, error), options ...retry.Option)
    
    	// Clusters for the Envoy instance
    	Clusters() (*admin.Clusters, error)
    	ClustersOrFail(t test.Failer) *admin.Clusters
    
    	// Listeners for the Envoy instance
    	Listeners() (*admin.Listeners, error)
    	ListenersOrFail(t test.Failer) *admin.Listeners
    
    	// Logs returns the logs for the sidecar container
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jun 09 03:49:49 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  7. test/fixedbugs/issue27518b.go

    package main
    
    import "runtime"
    
    var finalized bool
    var err string
    
    type HeapObj [8]int64
    
    const filler int64 = 0x123456789abcdef0
    
    func (h *HeapObj) init() {
    	for i := 0; i < len(*h); i++ {
    		h[i] = filler
    	}
    }
    func (h *HeapObj) check() {
    	for i := 0; i < len(*h); i++ {
    		if h[i] != filler {
    			err = "filler overwritten"
    		}
    	}
    }
    
    type StackObj struct {
    	h *HeapObj
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 03 19:54:23 UTC 2018
    - 1.2K bytes
    - Viewed (0)
  8. pkg/test/util/assert/assert.go

    	}
    }
    
    // Error asserts the provided err is non-nil
    func Error(t test.Failer, err error) {
    	t.Helper()
    	if err == nil {
    		t.Fatal("expected error but got nil")
    	}
    }
    
    // NoError asserts the provided err is nil
    func NoError(t test.Failer, err error) {
    	t.Helper()
    	if err != nil {
    		t.Fatalf("expected no error but got: %v", err)
    	}
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Dec 18 17:21:50 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/util/shufflesharding/shufflesharding.go

    	return int(math.Ceil(math.Log2(float64(deckSize)) * float64(handSize)))
    }
    
    // Dealer contains some necessary parameters and provides some methods for shuffle sharding.
    // Dealer is thread-safe.
    type Dealer struct {
    	deckSize int
    	handSize int
    }
    
    // NewDealer will create a Dealer with the given deckSize and handSize, will return error when
    // deckSize or handSize is invalid as below.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Oct 23 08:38:03 UTC 2019
    - 4K bytes
    - Viewed (0)
  10. pkg/test/util/tmpl/evaluate.go

    }
    
    // EvaluateOrFail calls Evaluate and fails tests if it returns error.
    func EvaluateOrFail(t test.Failer, tpl string, data any) string {
    	t.Helper()
    	s, err := Evaluate(tpl, data)
    	if err != nil {
    		t.Fatalf("tmpl.EvaluateOrFail: %v", err)
    	}
    	return s
    }
    
    func EvaluateFileOrFail(t test.Failer, filePath string, data any) string {
    	t.Helper()
    	s, err := EvaluateFile(filePath, data)
    	if err != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 3.1K bytes
    - Viewed (0)
Back to top