From e8b70ce0da1bf3e91b843f7e8f5d4841d27cab0d Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Thu, 11 Jun 2020 11:08:24 +1200 Subject: [PATCH] Update docs --- test/e2e/framework/util.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index ec6271c2454..54722dd2a78 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -1297,6 +1297,10 @@ func taintExists(taints []v1.Taint, taintToFind *v1.Taint) bool { // expectedWatchEvents array of events which are expected to occur // scenario the test itself // retryCleanup a function to run which ensures that there are no dangling resources upon test failure +// this tooling relies on the test to return the events as they occur +// the entire scenario must be run to ensure that the desired watch events arrive in order (allowing for interweaving of watch events) +// if an expected watch event is missing we elect to clean up and run the entire scenario again +// we try the scenario three times to allow the sequencing to fail a couple of times func WatchEventSequenceVerifier(ctx context.Context, dc dynamic.Interface, resourceType schema.GroupVersionResource, namespace string, resourceName string, listOptions metav1.ListOptions, expectedWatchEvents []watch.Event, scenario func(*watchtools.RetryWatcher) []watch.Event, retryCleanup func() error) { listWatcher := &cache.ListWatch{ WatchFunc: func(listOptions metav1.ListOptions) (watch.Interface, error) { @@ -1304,7 +1308,6 @@ func WatchEventSequenceVerifier(ctx context.Context, dc dynamic.Interface, resou }, } - // NOTE value of 3 retries seems to make sense retries := 3 retriesLoop: for try := 1; try <= retries; try++ {