fix unstable integration test

Signed-off-by: roywang <seiwy2010@gmail.com>
This commit is contained in:
roywang
2020-12-24 18:22:27 +09:00
parent a8f48eb140
commit 9730cb438d
+7 -1
View File
@@ -159,7 +159,13 @@ func TestAppConfigController(t *testing.T) {
},
}))
if err := c.Create(context.Background(), ac); err != nil {
if err := waitFor(context.Background(), 3*time.Second, func() (bool, error) {
// re-try because validating-webhook may fail for workloadDefinition is not found
if err := c.Create(context.Background(), ac); err != nil {
return false, err
}
return true, nil
}); err != nil {
return err
}