Deflake operation listing.

This commit is contained in:
Brendan Burns 2014-08-26 22:00:26 -07:00
parent e1a361a84b
commit 52473bdf11

View File

@ -92,7 +92,15 @@ func TestOperation(t *testing.T) {
}
func TestOperationsList(t *testing.T) {
simpleStorage := &SimpleRESTStorage{}
testOver := make(chan struct{})
defer close(testOver)
simpleStorage := &SimpleRESTStorage{
injectedFunction: func(obj interface{}) (interface{}, error) {
// Eliminate flakes by ensuring the create operation takes longer than this test.
<-testOver
return obj, nil
},
}
handler := Handle(map[string]RESTStorage{
"foo": simpleStorage,
}, codec, "/prefix/version")