Skip to content

Commit

Permalink
Fix a possible flake where the referenced APIExport may not be availa…
Browse files Browse the repository at this point in the history
…ble on the cache server before the APIExportEndpointSlice is created.

Signed-off-by: Frederic Giloux <fgiloux@redhat.com>
  • Loading branch information
fgiloux committed Feb 7, 2023
1 parent 3a58b1c commit 3df11d7
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,14 @@ func TestAPIExportEndpointSliceWithPartitionPrivate(t *testing.T) {

t.Logf("Creating the APIExportEndpointSlice")
sliceClient := kcpClusterClient.ApisV1alpha1().APIExportEndpointSlices()
slice, err = sliceClient.Cluster(partitionClusterPath).Create(ctx, slice, metav1.CreateOptions{})
require.NoError(t, err)
// allow some time for APIExport to be synced onto the cache server
framework.Eventually(t, func() (bool, string) {
slice, err = sliceClient.Cluster(partitionClusterPath).Create(ctx, slice, metav1.CreateOptions{})
if err != nil {
return false, err.Error()
}
return true, ""
}, wait.ForeverTestTimeout, 100*time.Millisecond, "expected successful creation of APIExportEndpointSlice")
sliceName := slice.Name

framework.Eventually(t, func() (bool, string) {
Expand Down

0 comments on commit 3df11d7

Please sign in to comment.