Retry on Webhook EOF in conformance tests
@@ -117,9 +117,11 @@ func readyBrokerV1AvailableHelper(t *testing.T, brokerName string, client *testl
func brokerV1ConfigCanNotBeUpdated(t *testing.T, brokerName string, client *testlib.Client) {
client.WaitForResourceReadyOrFail(brokerName, testlib.BrokerTypeMeta)
+ err := client.RetryWebhookErrors(func(i int) error {
broker, err := client.Eventing.EventingV1().Brokers(client.Namespace).Get(context.Background(), brokerName, metav1.GetOptions{})
if err != nil {
- t.Fatalf("Error: Could not get broker %s: %v", brokerName, err)
+ t.Logf("Error: Could not get broker %s: %v", brokerName, err)
+ return err
}
broker.Spec = eventingv1.BrokerSpec{
Config: &v1.KReference{
@@ -131,6 +133,8 @@ func brokerV1ConfigCanNotBeUpdated(t *testing.T, brokerName string, client *test
}
_, err = client.Eventing.EventingV1().Brokers(client.Namespace).Update(context.Background(), broker, metav1.UpdateOptions{})
+ return err
+ })
if err == nil {
t.Fatalf("Error: Was able to update the broker.Spec.Config %s", brokerName)
}
@@ -150,7 +154,8 @@ func triggerV1ReadyBrokerReadyHelper(triggerName, brokerName string, client *tes
}
func triggerV1CanNotUpdateBroker(t *testing.T, triggerName, brokerName string, client *testlib.Client) {
- err := reconciler.RetryUpdateConflicts(func(attempts int) (err error) {
+ err := client.RetryWebhookErrors(func(i int) error {
+ return reconciler.RetryUpdateConflicts(func(attempts int) (err error) {
tr, err := client.Eventing.EventingV1().Triggers(client.Namespace).Get(context.Background(), triggerName, metav1.GetOptions{})
if err != nil {
t.Fatalf("Error: Could not get trigger %s: %v", triggerName, err)
@@ -159,6 +164,7 @@ func triggerV1CanNotUpdateBroker(t *testing.T, triggerName, brokerName string, c
_, e := client.Eventing.EventingV1().Triggers(client.Namespace).Update(context.Background(), tr, metav1.UpdateOptions{})
return e
})
+ })
if err == nil {
t.Fatalf("Error: Was able to update the trigger.Spec.Broker %s", triggerName)
}
