mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Deflake the TestCreate test, by adding an explicit wait.
This commit is contained in:
parent
808be2d13b
commit
f02fe2da1b
@ -501,7 +501,14 @@ func TestUpdateMissing(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCreate(t *testing.T) {
|
func TestCreate(t *testing.T) {
|
||||||
simpleStorage := &SimpleRESTStorage{}
|
wait := sync.WaitGroup{}
|
||||||
|
wait.Add(1)
|
||||||
|
simpleStorage := &SimpleRESTStorage{
|
||||||
|
injectedFunction: func(obj runtime.Object) (returnObj runtime.Object, err error) {
|
||||||
|
wait.Wait()
|
||||||
|
return &Simple{}, nil
|
||||||
|
},
|
||||||
|
}
|
||||||
handler := Handle(map[string]RESTStorage{
|
handler := Handle(map[string]RESTStorage{
|
||||||
"foo": simpleStorage,
|
"foo": simpleStorage,
|
||||||
}, codec, "/prefix/version", selfLinker)
|
}, codec, "/prefix/version", selfLinker)
|
||||||
@ -537,6 +544,7 @@ func TestCreate(t *testing.T) {
|
|||||||
if itemOut.Status != api.StatusWorking || itemOut.Details == nil || itemOut.Details.ID == "" {
|
if itemOut.Status != api.StatusWorking || itemOut.Details == nil || itemOut.Details.ID == "" {
|
||||||
t.Errorf("Unexpected status: %#v (%s)", itemOut, string(body))
|
t.Errorf("Unexpected status: %#v (%s)", itemOut, string(body))
|
||||||
}
|
}
|
||||||
|
wait.Done()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCreateNotFound(t *testing.T) {
|
func TestCreateNotFound(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user