Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 37 for testclock (3.1 sec)

  1. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/metrics/timing_ratio_histogram_test.go

    	"k8s.io/klog/v2"
    	testclock "k8s.io/utils/clock/testing"
    )
    
    const (
    	ddtRangeCentiPeriods  = 300
    	ddtOffsetCentiPeriods = 50
    	numIterations         = 100
    )
    
    var errMetricNotFound = errors.New("not found")
    
    func TestTimingRatioHistogramVecElementSimple(t *testing.T) {
    	testHistogramName := "vec_element_simple"
    	t0 := time.Now()
    	clk := testclock.NewFakePassiveClock(t0)
    	buckets := []float64{0, 1}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jul 13 16:03:06 UTC 2022
    - 8.7K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/request/object_count_tracker_test.go

    See the License for the specific language governing permissions and
    limitations under the License.
    */
    
    package request
    
    import (
    	"reflect"
    	"testing"
    	"time"
    
    	"github.com/google/go-cmp/cmp"
    	testclock "k8s.io/utils/clock/testing"
    )
    
    func TestStorageObjectCountTracker(t *testing.T) {
    	tests := []struct {
    		name          string
    		lastUpdated   time.Duration
    		count         int64
    		errExpected   error
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 17 19:36:14 UTC 2021
    - 3.4K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/integrator_test.go

    limitations under the License.
    */
    
    package fairqueuing
    
    import (
    	"math"
    	"testing"
    	"time"
    
    	testclock "k8s.io/utils/clock/testing"
    )
    
    func TestIntegrator(t *testing.T) {
    	now := time.Now()
    	clk := testclock.NewFakeClock(now)
    	igr := NewNamedIntegrator(clk, "testee")
    	igr.Add(3)
    	clk.Step(time.Second)
    	results := igr.GetResults()
    	rToo := igr.Reset()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 27 21:11:44 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  4. pkg/backoff/exponential_test.go

    		actualInterval := exp.NextBackOff()
    		if !(minInterval <= actualInterval && actualInterval <= maxInterval) {
    			t.Error("error")
    		}
    	}
    }
    
    type TestClock struct {
    	i     time.Duration
    	start time.Time
    }
    
    func (c *TestClock) Now() time.Time {
    	t := c.start.Add(c.i)
    	c.i += time.Second
    	return t
    }
    
    func TestRetry(t *testing.T) {
    	o := DefaultOption()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Sep 05 16:03:30 UTC 2022
    - 2.6K bytes
    - Viewed (0)
  5. src/crypto/aes/modes_test.go

    type testInterface interface {
    	InAESPackage() bool
    }
    
    // testBlock implements the cipher.Block interface and any *Able
    // interfaces that need to be tested.
    type testBlock struct{}
    
    func (*testBlock) BlockSize() int      { return 0 }
    func (*testBlock) Encrypt(a, b []byte) {}
    func (*testBlock) Decrypt(a, b []byte) {}
    func (*testBlock) NewGCM(int, int) (cipher.AEAD, error) {
    	return &testAEAD{}, nil
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 14 15:32:26 UTC 2018
    - 3.5K bytes
    - Viewed (0)
  6. test/chan/select3.go

    	// receiving from a non-ready channel always blocks
    	testBlock(always, func() {
    		ch := make(chan int)
    		<-ch
    	})
    
    	// empty selects always block
    	testBlock(always, func() {
    		select {}
    	})
    
    	// selects with only nil channels always block
    	testBlock(always, func() {
    		select {
    		case <-nilch:
    			unreachable()
    		}
    	})
    	testBlock(always, func() {
    		select {
    		case nilch <- 7:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jul 08 02:10:12 UTC 2017
    - 4.1K bytes
    - Viewed (0)
  7. src/crypto/issue21104_test.go

    func TestCTROutOfBoundsWrite(t *testing.T) {
    	testBlock(t, "CTR", cipher.NewCTR)
    }
    func TestOFBOutOfBoundsWrite(t *testing.T) {
    	testBlock(t, "OFB", cipher.NewOFB)
    }
    func TestCFBEncryptOutOfBoundsWrite(t *testing.T) {
    	testBlock(t, "CFB Encrypt", cipher.NewCFBEncrypter)
    }
    func TestCFBDecryptOutOfBoundsWrite(t *testing.T) {
    	testBlock(t, "CFB Decrypt", cipher.NewCFBDecrypter)
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 06 06:03:36 UTC 2017
    - 1.8K bytes
    - Viewed (0)
  8. platforms/core-runtime/base-services/src/test/groovy/org/gradle/internal/work/DefaultWorkerLeaseServiceProjectLockTest.groovy

                        workerLeaseService.withLocks([projectLock]) {
                            assert testLock.tryLock()
                            try {
                                assert lockIsHeld(projectLock)
                            } finally {
                                testLock.unlock()
                            }
                        }
                    }
                }
                started.await()
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Apr 05 16:29:26 UTC 2024
    - 25.6K bytes
    - Viewed (0)
  9. pilot/pkg/leaderelection/leaderelection_test.go

    	"k8s.io/client-go/kubernetes"
    	"k8s.io/client-go/kubernetes/fake"
    	k8stesting "k8s.io/client-go/testing"
    
    	"istio.io/istio/pkg/revisions"
    	"istio.io/istio/pkg/test/util/retry"
    )
    
    const testLock = "test-lock"
    
    func createElection(t *testing.T,
    	name string, revision string,
    	watcher revisions.DefaultWatcher,
    	expectLeader bool,
    	client kubernetes.Interface, fns ...func(stop <-chan struct{}),
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sun Apr 28 04:22:19 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  10. src/archive/tar/writer_test.go

    		}
    		testReadFrom struct { // ReadFrom(testFile{ops}) == (wantCnt, wantErr)
    			ops     fileOps
    			wantCnt int64
    			wantErr error
    		}
    		testClose struct { // Close() == wantErr
    			wantErr error
    		}
    		testFnc any // testHeader | testWrite | testReadFrom | testClose
    	)
    
    	vectors := []struct {
    		file  string // Optional filename of expected output
    		tests []testFnc
    	}{{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 38.7K bytes
    - Viewed (0)
Back to top