Unify queue constructors, deprecate current constructors

Kubernetes-commit: fea83b78243c77e81b91f3f0a812979809aeacaf
This commit is contained in:
austin ce
2023-03-10 17:46:26 -05:00
committed by Kubernetes Publisher
parent 9668243c04
commit 66fa9d308f
6 changed files with 154 additions and 89 deletions

View File

@@ -29,7 +29,7 @@ import (
func TestSimpleQueue(t *testing.T) {
fakeClock := testingclock.NewFakeClock(time.Now())
q := NewDelayingQueueWithCustomClock(fakeClock, "")
q := NewDelayingQueueWithConfig(DelayingQueueConfig{Clock: fakeClock})
first := "foo"
@@ -71,7 +71,7 @@ func TestSimpleQueue(t *testing.T) {
func TestDeduping(t *testing.T) {
fakeClock := testingclock.NewFakeClock(time.Now())
q := NewDelayingQueueWithCustomClock(fakeClock, "")
q := NewDelayingQueueWithConfig(DelayingQueueConfig{Clock: fakeClock})
first := "foo"
@@ -127,7 +127,7 @@ func TestDeduping(t *testing.T) {
func TestAddTwoFireEarly(t *testing.T) {
fakeClock := testingclock.NewFakeClock(time.Now())
q := NewDelayingQueueWithCustomClock(fakeClock, "")
q := NewDelayingQueueWithConfig(DelayingQueueConfig{Clock: fakeClock})
first := "foo"
second := "bar"
@@ -176,7 +176,7 @@ func TestAddTwoFireEarly(t *testing.T) {
func TestCopyShifting(t *testing.T) {
fakeClock := testingclock.NewFakeClock(time.Now())
q := NewDelayingQueueWithCustomClock(fakeClock, "")
q := NewDelayingQueueWithConfig(DelayingQueueConfig{Clock: fakeClock})
first := "foo"
second := "bar"
@@ -214,7 +214,7 @@ func TestCopyShifting(t *testing.T) {
func BenchmarkDelayingQueue_AddAfter(b *testing.B) {
fakeClock := testingclock.NewFakeClock(time.Now())
q := NewDelayingQueueWithCustomClock(fakeClock, "")
q := NewDelayingQueueWithConfig(DelayingQueueConfig{Clock: fakeClock})
// Add items
for n := 0; n < b.N; n++ {