Wait until stores are filled before processing service account token events

This commit is contained in:
Jordan Liggitt
2015-05-19 05:24:17 -04:00
parent d3778f5f5a
commit 49ceb82179
5 changed files with 69 additions and 6 deletions

View File

@@ -214,10 +214,20 @@ func TestHammerController(t *testing.T) {
},
)
if controller.HasSynced() {
t.Errorf("Expected HasSynced() to return false before we started the controller")
}
// Run the controller and run it until we close stop.
stop := make(chan struct{})
go controller.Run(stop)
// Let's wait for the controller to do its initial sync
time.Sleep(100 * time.Millisecond)
if !controller.HasSynced() {
t.Errorf("Expected HasSynced() to return true after the initial sync")
}
wg := sync.WaitGroup{}
const threads = 3
wg.Add(threads)