Skip to content

Commit

Permalink
reverted the code from 23688 that cause race condition with older ver…
Browse files Browse the repository at this point in the history
…sion of Go
  • Loading branch information
grodrigues3 committed Jun 30, 2016
1 parent 5478aa8 commit 02e29a9
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions pkg/client/record/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,7 @@ func TestEventf(t *testing.T) {
recorder := recorderWithFakeClock(api.EventSource{Component: "eventTest"}, eventBroadcaster, clock)
for index, item := range table {
clock.Step(1 * time.Second)
// TODO: uncomment this after we upgrade to Go 1.6.1.
// testing.(*common).log() is racing with testing.(*T).report() in Go 1.6.
// See #23533 for more details.
// logWatcher1 := eventBroadcaster.StartLogging(t.Logf) // Prove that it is useful
logWatcher1 := eventBroadcaster.StartLogging(t.Logf) // Prove that it is useful
logWatcher2 := eventBroadcaster.StartLogging(func(formatter string, args ...interface{}) {
if e, a := item.expectLog, fmt.Sprintf(formatter, args...); e != a {
t.Errorf("Expected '%v', got '%v'", e, a)
Expand All @@ -372,8 +369,7 @@ func TestEventf(t *testing.T) {
actualEvent := <-createEvent
validateEvent(string(index), actualEvent, item.expect, t)
}
// TODO: uncomment this after we upgrade to Go 1.6.1.
// logWatcher1.Stop()
logWatcher1.Stop()
logWatcher2.Stop()
}
sinkWatcher.Stop()
Expand Down Expand Up @@ -601,10 +597,7 @@ func TestEventfNoNamespace(t *testing.T) {

for index, item := range table {
clock.Step(1 * time.Second)
// TODO: uncomment this after we upgrade to Go 1.6.1.
// testing.(*common).log() is racing with testing.(*T).report() in Go 1.6.
// See #23533 for more details.
// logWatcher1 := eventBroadcaster.StartLogging(t.Logf) // Prove that it is useful
logWatcher1 := eventBroadcaster.StartLogging(t.Logf) // Prove that it is useful
logWatcher2 := eventBroadcaster.StartLogging(func(formatter string, args ...interface{}) {
if e, a := item.expectLog, fmt.Sprintf(formatter, args...); e != a {
t.Errorf("Expected '%v', got '%v'", e, a)
Expand All @@ -624,8 +617,7 @@ func TestEventfNoNamespace(t *testing.T) {
validateEvent(string(index), actualEvent, item.expect, t)
}

// TODO: uncomment this after we upgrade to Go 1.6.1.
// logWatcher1.Stop()
logWatcher1.Stop()
logWatcher2.Stop()
}
sinkWatcher.Stop()
Expand Down

0 comments on commit 02e29a9

Please sign in to comment.