mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
remove logWatcher to logf
This commit is contained in:
parent
5841f6e164
commit
2558c239b8
@ -350,8 +350,7 @@ func TestEventf(t *testing.T) {
|
|||||||
recorder := recorderWithFakeClock(api.EventSource{Component: "eventTest"}, eventBroadcaster, clock)
|
recorder := recorderWithFakeClock(api.EventSource{Component: "eventTest"}, eventBroadcaster, clock)
|
||||||
for index, item := range table {
|
for index, item := range table {
|
||||||
clock.Step(1 * time.Second)
|
clock.Step(1 * time.Second)
|
||||||
logWatcher1 := eventBroadcaster.StartLogging(t.Logf) // Prove that it is useful
|
logWatcher := eventBroadcaster.StartLogging(func(formatter string, args ...interface{}) {
|
||||||
logWatcher2 := eventBroadcaster.StartLogging(func(formatter string, args ...interface{}) {
|
|
||||||
if e, a := item.expectLog, fmt.Sprintf(formatter, args...); e != a {
|
if e, a := item.expectLog, fmt.Sprintf(formatter, args...); e != a {
|
||||||
t.Errorf("Expected '%v', got '%v'", e, a)
|
t.Errorf("Expected '%v', got '%v'", e, a)
|
||||||
}
|
}
|
||||||
@ -369,8 +368,7 @@ func TestEventf(t *testing.T) {
|
|||||||
actualEvent := <-createEvent
|
actualEvent := <-createEvent
|
||||||
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
|
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
|
||||||
}
|
}
|
||||||
logWatcher1.Stop()
|
logWatcher.Stop()
|
||||||
logWatcher2.Stop()
|
|
||||||
}
|
}
|
||||||
sinkWatcher.Stop()
|
sinkWatcher.Stop()
|
||||||
}
|
}
|
||||||
@ -597,8 +595,7 @@ func TestEventfNoNamespace(t *testing.T) {
|
|||||||
|
|
||||||
for index, item := range table {
|
for index, item := range table {
|
||||||
clock.Step(1 * time.Second)
|
clock.Step(1 * time.Second)
|
||||||
logWatcher1 := eventBroadcaster.StartLogging(t.Logf) // Prove that it is useful
|
logWatcher := eventBroadcaster.StartLogging(func(formatter string, args ...interface{}) {
|
||||||
logWatcher2 := eventBroadcaster.StartLogging(func(formatter string, args ...interface{}) {
|
|
||||||
if e, a := item.expectLog, fmt.Sprintf(formatter, args...); e != a {
|
if e, a := item.expectLog, fmt.Sprintf(formatter, args...); e != a {
|
||||||
t.Errorf("Expected '%v', got '%v'", e, a)
|
t.Errorf("Expected '%v', got '%v'", e, a)
|
||||||
}
|
}
|
||||||
@ -617,8 +614,7 @@ func TestEventfNoNamespace(t *testing.T) {
|
|||||||
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
|
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
logWatcher1.Stop()
|
logWatcher.Stop()
|
||||||
logWatcher2.Stop()
|
|
||||||
}
|
}
|
||||||
sinkWatcher.Stop()
|
sinkWatcher.Stop()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user